Line data Source code
1 : /**************************************************************************
2 :
3 :
4 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 :
6 :
7 : * *
8 :
9 :
10 : * Author: The ALICE Off-line Project. *
11 :
12 :
13 : * Contributors are mentioned in the code where appropriate. *
14 :
15 :
16 : * *
17 :
18 :
19 : * Permission to use, copy, modify and distribute this software and its *
20 :
21 :
22 : * documentation strictly for non-commercial purposes is hereby granted *
23 :
24 :
25 : * without fee, provided that the above copyright notice appears in all *
26 :
27 :
28 : * copies and that both the copyright notice and this permission notice *
29 :
30 :
31 : * appear in the supporting documentation. The authors make no claims *
32 :
33 :
34 : * about the suitability of this software for any purpose. It is *
35 :
36 :
37 : * provided "as is" without express or implied warranty. *
38 :
39 :
40 : **************************************************************************/
41 :
42 :
43 :
44 :
45 :
46 : /* $Id: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */
47 :
48 :
49 :
50 :
51 :
52 : //-----------------------------------------------------------------
53 :
54 :
55 : // Implementation of the TPC Kr cluster class
56 :
57 :
58 : //
59 :
60 :
61 : // Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl
62 :
63 :
64 : //-----------------------------------------------------------------
65 :
66 :
67 :
68 :
69 :
70 : #include "AliTPCclusterKr.h"
71 :
72 :
73 : #include "AliCluster.h"
74 :
75 :
76 : #include "AliTPCvtpr.h"
77 :
78 :
79 : #include "TObjArray.h"
80 :
81 :
82 : //#include "TH1F.h"
83 :
84 :
85 : #include "TMath.h"
86 :
87 :
88 : #include "TArrayI.h"
89 :
90 :
91 :
92 :
93 :
94 16 : ClassImp(AliTPCclusterKr)
95 :
96 :
97 :
98 :
99 :
100 :
101 :
102 :
103 : AliTPCclusterKr::AliTPCclusterKr()
104 :
105 :
106 0 : :AliCluster(),
107 :
108 :
109 0 : fMax(),
110 :
111 :
112 0 : fADCcluster(0),
113 :
114 :
115 0 : fSec(0),
116 :
117 :
118 0 : fNPads(0),
119 :
120 :
121 0 : fNRows(0),
122 :
123 :
124 0 : fTimebins1D(0),
125 :
126 :
127 0 : fPads1D(0),
128 :
129 :
130 0 : fPadRMS(0),
131 :
132 :
133 0 : fRowRMS(0),
134 :
135 :
136 0 : fTimebinRMS(0),
137 :
138 :
139 0 : fSize(0),
140 :
141 :
142 0 : fCenterX(0),
143 :
144 :
145 0 : fCenterY(0),
146 :
147 :
148 0 : fCenterT(0),
149 :
150 :
151 0 : fCluster(0),
152 :
153 :
154 0 : fTimeStamp(0),
155 0 : fRun(0)
156 :
157 :
158 0 : {
159 :
160 :
161 : //
162 :
163 :
164 : // default constructor
165 :
166 :
167 : //
168 :
169 :
170 0 : fCluster=new TObjArray();
171 :
172 :
173 0 : }
174 :
175 :
176 :
177 :
178 :
179 : AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr ¶m)
180 :
181 :
182 0 : :AliCluster(param),
183 :
184 :
185 0 : fMax(),
186 :
187 :
188 0 : fADCcluster(0),
189 :
190 :
191 0 : fSec(0),
192 :
193 :
194 0 : fNPads(0),
195 :
196 :
197 0 : fNRows(0),
198 :
199 :
200 0 : fTimebins1D(0),
201 :
202 :
203 0 : fPads1D(0),
204 :
205 :
206 0 : fPadRMS(0),
207 :
208 :
209 0 : fRowRMS(0),
210 :
211 :
212 0 : fTimebinRMS(0),
213 :
214 :
215 0 : fSize(0),
216 :
217 :
218 0 : fCenterX(0),
219 :
220 :
221 0 : fCenterY(0),
222 :
223 :
224 0 : fCenterT(0),
225 :
226 :
227 0 : fCluster(0),
228 :
229 :
230 0 : fTimeStamp(0),
231 0 : fRun(0)
232 :
233 :
234 0 : {
235 :
236 :
237 : //
238 :
239 :
240 : // copy constructor
241 :
242 :
243 : //
244 :
245 :
246 0 : fADCcluster = param.fADCcluster;
247 :
248 :
249 0 : fSec = param.fSec ;
250 :
251 :
252 0 : fNPads = param.fNPads;
253 :
254 :
255 0 : fNRows = param.fNRows;
256 :
257 :
258 0 : fMax = param.fMax;
259 :
260 :
261 : // fCluster = param.fCluster;
262 :
263 :
264 0 : fCenterX = param.fCenterX;
265 :
266 :
267 0 : fCenterY = param.fCenterY;
268 :
269 :
270 0 : fCenterT = param.fCenterT;
271 :
272 :
273 0 : fCluster=new TObjArray(*(param.fCluster));
274 :
275 :
276 0 : fSize = param.fSize;
277 :
278 :
279 0 : fTimebins1D = param.fTimebins1D;
280 :
281 :
282 0 : fPads1D = param.fPads1D;
283 :
284 :
285 0 : fPadRMS = param.fPadRMS;
286 :
287 :
288 0 : fRowRMS = param.fRowRMS;
289 :
290 :
291 0 : fTimebinRMS = param.fTimebinRMS;
292 :
293 :
294 0 : fTimeStamp = param.fTimeStamp;
295 0 : fRun = param.fRun;
296 :
297 :
298 0 : }
299 :
300 :
301 :
302 :
303 :
304 : AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)
305 :
306 :
307 : {
308 :
309 :
310 : //
311 :
312 :
313 : // assignment operator
314 :
315 :
316 : //
317 0 : if (this == ¶m) return (*this);
318 :
319 0 : (AliCluster&)(*this) = (AliCluster&)param;
320 :
321 :
322 0 : fADCcluster = param.fADCcluster;
323 :
324 :
325 0 : fSec = param.fSec ;
326 :
327 :
328 0 : fNPads = param.fNPads;
329 :
330 :
331 0 : fNRows = param.fNRows;
332 :
333 :
334 0 : fMax = param.fMax;
335 :
336 :
337 : // fCluster=param.fCluster;
338 :
339 :
340 0 : fCenterX = param.fCenterX;
341 :
342 :
343 0 : fCenterY = param.fCenterY;
344 :
345 :
346 0 : fCenterT = param.fCenterT;
347 :
348 :
349 0 : delete fCluster;
350 :
351 :
352 0 : fCluster=new TObjArray(*(param.fCluster));
353 :
354 :
355 0 : fSize=param.fSize;
356 :
357 :
358 0 : fTimebins1D = param.fTimebins1D;
359 :
360 :
361 0 : fPads1D = param.fPads1D;
362 :
363 :
364 0 : fPadRMS = param.fPadRMS;
365 :
366 :
367 0 : fRowRMS = param.fRowRMS;
368 :
369 :
370 0 : fTimebinRMS = param.fTimebinRMS;
371 :
372 :
373 0 : fTimeStamp = param.fTimeStamp;
374 0 : fRun = param.fRun;
375 :
376 :
377 0 : return (*this);
378 :
379 :
380 0 : }
381 :
382 :
383 :
384 :
385 :
386 : AliTPCclusterKr::~AliTPCclusterKr()
387 :
388 :
389 0 : {
390 :
391 :
392 : //
393 :
394 :
395 : // destructor
396 :
397 :
398 : //
399 :
400 :
401 0 : if(fCluster) {
402 :
403 :
404 0 : fCluster->SetOwner(kTRUE);
405 :
406 :
407 0 : fCluster->Delete();
408 :
409 :
410 0 : delete fCluster;
411 :
412 :
413 : }
414 :
415 :
416 0 : fCluster=0;
417 :
418 :
419 0 : }
420 :
421 :
422 :
423 :
424 :
425 : ////____________________________________________________________________________
426 :
427 :
428 : void AliTPCclusterKr::SetCenter(){
429 :
430 :
431 : //
432 :
433 :
434 : // calculate geometrical center of the cluster
435 :
436 :
437 : //
438 :
439 :
440 : Double_t rX=0;
441 :
442 :
443 : Double_t rY=0;
444 :
445 :
446 : Double_t rT=0;
447 :
448 :
449 :
450 :
451 :
452 : Short_t adc;
453 :
454 :
455 0 : fADCcluster=0;
456 :
457 :
458 0 : for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {
459 :
460 :
461 0 : AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);
462 :
463 :
464 :
465 :
466 :
467 : //for( std::vector<AliTPCvtpr*>::iterator iclus = fCluster.begin();
468 :
469 :
470 : //iclus != fCluster.end(); ++iclus ) {
471 :
472 :
473 0 : adc = (iclus)->GetAdc();
474 :
475 :
476 0 : fADCcluster+=adc;
477 :
478 :
479 0 : rX += ((iclus)->GetX() * adc);
480 :
481 :
482 0 : rY += ((iclus)->GetY() * adc);
483 :
484 :
485 0 : rT += ((iclus)->GetT() * adc);
486 :
487 :
488 : }
489 0 : if(fADCcluster){
490 :
491 0 : fCenterX=rX/fADCcluster;
492 :
493 :
494 0 : fCenterY=rY/fADCcluster;
495 :
496 :
497 0 : fCenterT=rT/fADCcluster;
498 0 : }
499 :
500 :
501 :
502 :
503 :
504 : return;
505 :
506 :
507 0 : }
508 :
509 :
510 :
511 :
512 :
513 : void AliTPCclusterKr::SetPadRMS(){
514 :
515 :
516 : //
517 :
518 :
519 : // calculate RMS in pad direction
520 :
521 :
522 : //
523 :
524 :
525 : // TH1F *histo= new TH1F("","",200,0,200);
526 :
527 :
528 0 : TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
529 :
530 :
531 0 : for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
532 :
533 :
534 : {
535 :
536 :
537 0 : array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);
538 :
539 :
540 : //histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );
541 :
542 :
543 : }
544 :
545 :
546 : // fPadRMS=histo->GetRMS();
547 :
548 :
549 0 : fPadRMS=TMath::RMS(array->GetSize(),array->GetArray());
550 :
551 :
552 : // delete histo;
553 :
554 :
555 0 : delete array;
556 :
557 :
558 : return;
559 :
560 :
561 0 : }
562 :
563 :
564 :
565 :
566 :
567 : void AliTPCclusterKr::SetRowRMS(){
568 :
569 :
570 : //
571 :
572 :
573 : // calculate RMS in row direction
574 :
575 :
576 : //
577 :
578 :
579 0 : TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
580 :
581 :
582 : // TH1F *histo= new TH1F("","",120,0,120);
583 :
584 :
585 0 : for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
586 :
587 :
588 : {
589 :
590 :
591 0 : array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);
592 :
593 :
594 : // histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );
595 :
596 :
597 : }
598 :
599 :
600 : // fRowRMS=histo->GetRMS();
601 :
602 :
603 0 : fRowRMS=TMath::RMS(array->GetSize(),array->GetArray());
604 :
605 :
606 : // delete histo;
607 :
608 :
609 0 : delete array;
610 :
611 :
612 : return;
613 :
614 :
615 0 : }
616 :
617 :
618 :
619 :
620 :
621 : void AliTPCclusterKr::SetTimebinRMS(){
622 :
623 :
624 : //
625 :
626 :
627 : // calculate RMS in timebin direction
628 :
629 :
630 : //
631 :
632 :
633 0 : TArrayI *array= new TArrayI(fCluster->GetEntriesFast());
634 :
635 :
636 : // TH1F *histo= new TH1F("","",1000,0,1000);
637 :
638 :
639 0 : for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
640 :
641 :
642 : {
643 :
644 :
645 0 : array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);
646 :
647 :
648 : // histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );
649 :
650 :
651 : }
652 :
653 :
654 0 : fTimebinRMS=TMath::RMS(array->GetSize(),array->GetArray());
655 :
656 :
657 : //histo->GetRMS();
658 :
659 :
660 : // delete histo;
661 :
662 :
663 0 : delete array;
664 :
665 :
666 : return;
667 :
668 :
669 0 : }
670 :
671 :
672 :
673 :
674 :
675 : void AliTPCclusterKr::SetRMS(){
676 :
677 :
678 : //
679 :
680 :
681 : // calculate RMS in pad,row,timebin direction
682 :
683 :
684 : //
685 :
686 :
687 0 : TArrayI *arrayPad = new TArrayI(fCluster->GetEntriesFast());
688 :
689 :
690 0 : TArrayI *arrayRow = new TArrayI(fCluster->GetEntriesFast());
691 :
692 :
693 0 : TArrayI *arrayTime= new TArrayI(fCluster->GetEntriesFast());
694 :
695 :
696 : // TH1F *histoPad= new TH1F("p","p",200,0,200);
697 :
698 :
699 : // TH1F *histoRow= new TH1F("r","r",120,0,120);
700 :
701 :
702 : // TH1F *histoTime= new TH1F("t","t",1000,0,1000);
703 :
704 :
705 0 : for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
706 :
707 :
708 : {
709 :
710 :
711 0 : arrayPad->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);
712 :
713 :
714 0 : arrayRow->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);
715 :
716 :
717 0 : arrayTime->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);
718 :
719 :
720 :
721 :
722 :
723 : //histoPad->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );
724 :
725 :
726 : //histoRow->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );
727 :
728 :
729 : //histoTime->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );
730 :
731 :
732 : }
733 :
734 :
735 : // fPadRMS=histoPad->GetRMS();
736 :
737 :
738 0 : fPadRMS=TMath::RMS(arrayPad->GetSize(),arrayPad->GetArray());
739 :
740 :
741 0 : fRowRMS=TMath::RMS(arrayRow->GetSize(),arrayRow->GetArray());
742 :
743 :
744 : //histoRow->GetRMS();
745 :
746 :
747 0 : fTimebinRMS=TMath::RMS(arrayTime->GetSize(),arrayTime->GetArray());
748 :
749 :
750 : //histoTime->GetRMS();
751 :
752 :
753 :
754 :
755 :
756 0 : delete arrayPad;
757 :
758 :
759 0 : delete arrayRow;
760 :
761 :
762 0 : delete arrayTime;
763 :
764 :
765 : // delete histoPad;
766 :
767 :
768 : // delete histoRow;
769 :
770 :
771 : // delete histoTime;
772 :
773 :
774 :
775 :
776 :
777 : return;
778 :
779 :
780 0 : }
781 :
782 :
783 :
784 :
785 :
786 :
787 :
788 :
789 : void AliTPCclusterKr::Set1D(){
790 :
791 :
792 : //
793 :
794 :
795 : //
796 :
797 :
798 : //
799 :
800 :
801 : Short_t maxTime=0;
802 :
803 :
804 : Short_t minTime=1000;
805 :
806 :
807 : Short_t maxPad=0;
808 :
809 :
810 : Short_t minPad=1000;
811 :
812 :
813 :
814 :
815 :
816 0 : for(Int_t i=0;i<fCluster->GetEntriesFast();i++)
817 :
818 :
819 : {
820 :
821 :
822 0 : if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()>maxPad)maxPad =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();
823 :
824 :
825 0 : if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()<minPad)minPad =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();
826 :
827 :
828 0 : if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()>maxTime)maxTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();
829 :
830 :
831 0 : if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()<minTime)minTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();
832 :
833 :
834 : }
835 :
836 :
837 0 : fPads1D=maxPad-minPad+1;
838 :
839 :
840 0 : fTimebins1D=maxTime-minTime+1;
841 :
842 :
843 : return;
844 :
845 :
846 0 : }
847 :
848 :
|