1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 ////////////////////////////////////////////////////////////////////////
21 // This class defines the "Standard" reconstruction for the ITS //
24 ////////////////////////////////////////////////////////////////////////
25 #include "TObjArray.h"
28 #include "AliCDBManager.h"
29 #include "AliCDBEntry.h"
30 #include "AliITSClusterFinder.h"
31 #include "AliITSClusterFinderV2.h"
32 #include "AliITSClusterFinderV2SPD.h"
33 #include "AliITSClusterFinderV2SDD.h"
34 #include "AliITSClusterFinderV2SSD.h"
35 #include "AliITSClusterFinderSPD.h"
36 #include "AliITSClusterFinderSDD.h"
37 #include "AliITSClusterFinderSSD.h"
38 #include "AliITSDetTypeRec.h"
39 #include "AliITSRawCluster.h"
40 #include "AliITSRawClusterSPD.h"
41 #include "AliITSRawClusterSDD.h"
42 #include "AliITSRawClusterSSD.h"
43 #include "AliITSRecPoint.h"
44 #include "AliITSCalibrationSDD.h"
45 #include "AliITSsegmentationSPD.h"
46 #include "AliITSsegmentationSDD.h"
47 #include "AliITSsegmentationSSD.h"
51 const Int_t AliITSDetTypeRec::fgkNdettypes = 3;
52 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSPD = 240;
53 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSDD = 260;
54 const Int_t AliITSDetTypeRec::fgkDefaultNModulesSSD = 1698;
56 ClassImp(AliITSDetTypeRec)
58 //________________________________________________________________
59 AliITSDetTypeRec::AliITSDetTypeRec(): TObject(){
60 // Default Constructor
66 // A properly zero-ed AliITSDetTypeRec class.
73 for(Int_t i=0; i<3; i++){
74 fClusterClassName[i]=0;
76 fRecPointClassName[i]=0;
89 //________________________________________________________________
90 AliITSDetTypeRec::AliITSDetTypeRec(AliITSLoader *loader): TObject(){
91 // Standard Constructor
99 fReconstruction = new TObjArray(fgkNdettypes);
104 fDigits = new TObjArray(fgkNdettypes);
105 for(Int_t i=0; i<3; i++){
106 fClusterClassName[i]=0;
108 fRecPointClassName[i]=0;
110 fNdtype = new Int_t[fgkNdettypes];
111 fCtype = new TObjArray(fgkNdettypes);
112 fNctype = new Int_t[fgkNdettypes];
113 fNMod = new Int_t [fgkNdettypes];
114 fNMod[0] = fgkDefaultNModulesSPD;
115 fNMod[1] = fgkDefaultNModulesSDD;
116 fNMod[2] = fgkDefaultNModulesSSD;
117 fRecPoints = new TClonesArray("AliITSRecPoint",3000);
120 for(Int_t i=0;i<fgkNdettypes;i++){
130 //______________________________________________________________________
131 AliITSDetTypeRec::AliITSDetTypeRec(const AliITSDetTypeRec &/*rec*/):TObject(/*rec*/){
134 Error("Copy constructor","Copy constructor not allowed");
137 //______________________________________________________________________
138 AliITSDetTypeRec& AliITSDetTypeRec::operator=(const AliITSDetTypeRec& /*source*/){
139 // Assignment operator. This is a function which is not allowed to be
141 Error("operator=","Assignment operator not allowed\n");
145 //_____________________________________________________________________
146 AliITSDetTypeRec::~AliITSDetTypeRec(){
151 fReconstruction->Delete();
152 delete fReconstruction;
156 fSegmentation->Delete();
157 delete fSegmentation;
161 AliITSresponse* rspd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSPD()))->GetResponse();
162 AliITSresponse* rsdd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSDD()))->GetResponse();
163 AliITSresponse* rssd = ((AliITSCalibration*)fCalibration->At(GetITSgeom()->GetStartSSD()))->GetResponse();
164 if(rspd) delete rspd;
165 if(rsdd) delete rsdd;
166 if(rssd) delete rssd;
167 fCalibration->Delete();
171 if(fPreProcess) delete fPreProcess;
172 if(fPostProcess) delete fPostProcess;
180 fRecPoints->Delete();
192 if(fLoader) delete fLoader;
196 //___________________________________________________________________
197 void AliITSDetTypeRec::SetReconstructionModel(Int_t dettype,AliITSClusterFinder *clf){
199 //Set reconstruction model for detector type
201 if(fReconstruction==0) fReconstruction = new TObjArray(fgkNdettypes);
202 if(fReconstruction->At(dettype)!=0) delete fReconstruction->At(dettype);
203 fReconstruction->AddAt(clf,dettype);
205 //______________________________________________________________________
206 AliITSClusterFinder* AliITSDetTypeRec::GetReconstructionModel(Int_t dettype){
208 //Get reconstruction model for detector type
209 if(fReconstruction==0) {
210 Warning("GetReconstructionModel","fReconstruction is 0!");
213 return (AliITSClusterFinder*)fReconstruction->At(dettype);
216 //______________________________________________________________________
217 void AliITSDetTypeRec::SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg){
219 //Set segmentation model for detector type
221 if(fSegmentation==0) fSegmentation = new TObjArray(fgkNdettypes);
222 if(fSegmentation->At(dettype)!=0) delete fSegmentation->At(dettype);
223 fSegmentation->AddAt(seg,dettype);
226 //______________________________________________________________________
227 AliITSsegmentation* AliITSDetTypeRec::GetSegmentationModel(Int_t dettype){
229 //Get segmentation model for detector type
231 if(fSegmentation==0) {
232 Warning("GetSegmentationModel","fSegmentation is 0!");
235 return (AliITSsegmentation*)fSegmentation->At(dettype);
238 //_______________________________________________________________________
239 void AliITSDetTypeRec::SetCalibrationModel(Int_t iMod, AliITSCalibration *cal){
241 //Set calibration (response) for the module iMod of type dettype
242 if (fCalibration==0) {
243 fCalibration = new TObjArray(GetITSgeom()->GetIndexMax());
244 fCalibration->SetOwner(kTRUE);
245 fCalibration->Clear();
248 if (fCalibration->At(iMod) != 0)
249 delete (AliITSCalibration*) fCalibration->At(iMod);
250 fCalibration->AddAt(cal,iMod);
253 //_______________________________________________________________________
254 AliITSCalibration* AliITSDetTypeRec::GetCalibrationModel(Int_t iMod){
256 //Get calibration model for module type
258 if(fCalibration==0) {
259 Warning("GetalibrationModel","fCalibration is 0!");
263 return (AliITSCalibration*)fCalibration->At(iMod);
266 //______________________________________________________________________
267 void AliITSDetTypeRec::SetTreeAddress(){
268 // Set branch address for the Trees.
270 TTree *treeR = fLoader->TreeR();
271 TTree *treeD = fLoader->TreeD();
273 SetTreeAddressD(treeD);
274 SetTreeAddressR(treeR);
276 //______________________________________________________________________
277 void AliITSDetTypeRec::SetTreeAddressD(TTree *treeD){
278 // Set branch address for the tree of digits.
280 const char *det[4] = {"SPD","SDD","SSD","ITS"};
287 if (fDigits == 0x0) fDigits = new TObjArray(fgkNdettypes);
288 for (i=0; i<fgkNdettypes; i++) {
289 digclass = GetDigitClassName(i);
290 if(!(fDigits->At(i))) {
291 fDigits->AddAt(new TClonesArray(digclass,1000),i);
295 if (fgkNdettypes==3) sprintf(branchname,"%sDigits%s",det[3],det[i]);
296 else sprintf(branchname,"%sDigits%d",det[3],i+1);
298 branch = treeD->GetBranch(branchname);
299 if (branch) branch->SetAddress(&((*fDigits)[i]));
304 //_______________________________________________________________________
305 TBranch* AliITSDetTypeRec::MakeBranchInTree(TTree *tree, const char* name,
306 const char *classname,
307 void* address,Int_t size,
308 Int_t splitlevel, const char */*file*/)
311 // Makes branch in given tree and diverts them to a separate file
317 Error("MakeBranchInTree","Making Branch %s Tree is NULL",name);
320 TBranch *branch = tree->GetBranch(name);
325 branch = tree->Branch(name,classname,address,size,splitlevel);
328 branch = tree->Bronch(name, "TClonesArray", address, size, splitlevel);
334 //____________________________________________________________________
335 void AliITSDetTypeRec::SetDefaults(){
337 //Set defaults for segmentation and response
340 Warning("SetDefaults","null pointer to AliITSgeomGeom !");
344 AliITSsegmentation* seg;
345 if(!GetCalibration()) {AliFatal("Exit");exit(0);}
347 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
349 seg = new AliITSsegmentationSPD(GetITSgeom());
350 SetSegmentationModel(dettype,seg);
351 SetDigitClassName(dettype,"AliITSdigitSPD");
352 SetClusterClassName(dettype,"AliITSRawClusterSPD");
356 AliITSCalibrationSDD* res=(AliITSCalibrationSDD*) GetCalibrationModel(GetITSgeom()->GetStartSDD());
357 seg = new AliITSsegmentationSDD(GetITSgeom(),res);
358 SetSegmentationModel(dettype,seg);
359 const char *kopt = ((AliITSresponseSDD*)res->GetResponse())->ZeroSuppOption();
360 if((!strstr(kopt,"2D"))&&(!strstr(kopt,"1D"))) SetDigitClassName(dettype,"AliITSdigit");
361 else SetDigitClassName(dettype,"AliITSdigitSDD");
362 SetClusterClassName(dettype,"AliITSRawClusterSDD");
366 AliITSsegmentationSSD* seg2 = new AliITSsegmentationSSD(GetITSgeom());
367 seg2->SetAngles(0.0075,0.0275); // strip angels rad P and N side.
368 seg2->SetAnglesLay5(0.0075,0.0275); // strip angels rad P and N side.
369 seg2->SetAnglesLay6(0.0275,0.0075); // strip angels rad P and N side.
370 SetSegmentationModel(dettype,seg2);
371 SetDigitClassName(dettype,"AliITSdigitSSD");
372 SetClusterClassName(dettype,"AliITSRawClusterSSD");
377 //______________________________________________________________________
378 Bool_t AliITSDetTypeRec::GetCalibration() {
379 // Get Default calibration if a storage is not defined.
382 AliCDBEntry *entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD", fRunNumber);
383 AliCDBEntry *entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD", fRunNumber);
384 AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD", fRunNumber);
385 AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", fRunNumber);
386 AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", fRunNumber);
387 AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", fRunNumber);
389 if(!entrySPD || !entrySDD || !entrySSD || !entry2SPD || !entry2SDD || !entry2SSD){
390 AliWarning("Calibration object retrieval failed! Dummy calibration will be used.");
391 AliCDBStorage *origStorage = AliCDBManager::Instance()->GetDefaultStorage();
392 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
394 entrySPD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSPD", fRunNumber);
395 entrySDD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSDD", fRunNumber);
396 entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD", fRunNumber);
397 entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD", fRunNumber);
398 entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD", fRunNumber);
399 entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD", fRunNumber);
401 AliCDBManager::Instance()->SetDefaultStorage(origStorage);
405 TObjArray *respSPD = (TObjArray *)entrySPD->GetObject();
406 entrySPD->SetObject(NULL);
407 entrySPD->SetOwner(kTRUE);
409 AliITSresponseSPD *pSPD = (AliITSresponseSPD*)entry2SPD->GetObject();
410 entry2SPD->SetObject(NULL);
411 entry2SPD->SetOwner(kTRUE);
413 TObjArray *respSDD = (TObjArray *)entrySDD->GetObject();
414 entrySDD->SetObject(NULL);
415 entrySDD->SetOwner(kTRUE);
417 AliITSresponseSDD *pSDD = (AliITSresponseSDD*)entry2SDD->GetObject();
418 entry2SDD->SetObject(NULL);
419 entry2SDD->SetOwner(kTRUE);
421 TObjArray *respSSD = (TObjArray *)entrySSD->GetObject();
422 entrySSD->SetObject(NULL);
423 entrySSD->SetOwner(kTRUE);
425 AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
426 entry2SSD->SetObject(NULL);
427 entry2SSD->SetOwner(kTRUE);
429 // DB entries are dleted. In this waymetadeta objects are deleted as well
438 if ((!pSPD)||(!pSDD)||(!pSSD) || (!respSPD) || (!respSDD) || (!respSSD)) {
439 AliWarning("Can not get calibration from calibration database !");
443 fNMod[0] = respSPD->GetEntries();
444 fNMod[1] = respSDD->GetEntries();
445 fNMod[2] = respSSD->GetEntries();
446 AliInfo(Form("%i SPD, %i SDD and %i SSD in calibration database",
447 fNMod[0], fNMod[1], fNMod[2]));
448 AliITSCalibration* res;
449 for (Int_t i=0; i<fNMod[0]; i++) {
450 res = (AliITSCalibration*) respSPD->At(i);
451 res->SetResponse((AliITSresponse*)pSPD);
452 SetCalibrationModel(i, res);
454 for (Int_t i=0; i<fNMod[1]; i++) {
455 res = (AliITSCalibration*) respSDD->At(i);
456 res->SetResponse((AliITSresponse*)pSDD);
457 Int_t iMod = i + fNMod[0];
458 SetCalibrationModel(iMod, res);
460 for (Int_t i=0; i<fNMod[2]; i++) {
461 res = (AliITSCalibration*) respSSD->At(i);
462 res->SetResponse((AliITSresponse*)pSSD);
463 Int_t iMod = i + fNMod[0] + fNMod[1];
464 SetCalibrationModel(iMod, res);
471 //________________________________________________________________
472 void AliITSDetTypeRec::SetDefaultClusterFinders(){
474 //set defaults for standard cluster finder
477 Warning("SetDefaults","null pointer to AliITSgeom!");
481 AliITSClusterFinder *clf;
485 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
488 if(!GetReconstructionModel(dettype)){
489 TClonesArray *dig0 = DigitsAddress(0);
490 TClonesArray *rec0 = ClustersAddress(0);
491 clf = new AliITSClusterFinderSPD(this,dig0,rec0);
492 SetReconstructionModel(dettype,clf);
499 if(!GetReconstructionModel(dettype)){
500 TClonesArray *dig1 = DigitsAddress(1);
501 TClonesArray *rec1 = ClustersAddress(1);
502 clf = new AliITSClusterFinderSDD(this,dig1,rec1);
503 SetReconstructionModel(dettype,clf);
509 if(!GetReconstructionModel(dettype)){
510 TClonesArray* dig2 = DigitsAddress(2);
511 clf = new AliITSClusterFinderSSD(this,dig2);
512 SetReconstructionModel(dettype,clf);
521 //________________________________________________________________
522 void AliITSDetTypeRec::SetDefaultClusterFindersV2(Bool_t rawdata){
524 //Set defaults for cluster finder V2
527 Warning("SetDefaults","Null pointer to AliITSgeom !");
531 AliITSClusterFinder *clf;
534 for(Int_t dettype=0;dettype<fgkNdettypes;dettype++){
537 if(!GetReconstructionModel(dettype)){
538 clf = new AliITSClusterFinderV2SPD(this);
540 if(!rawdata) clf->SetDigits(DigitsAddress(0));
541 SetReconstructionModel(dettype,clf);
547 if(!GetReconstructionModel(dettype)){
548 clf = new AliITSClusterFinderV2SDD(this);
550 if(!rawdata) clf->SetDigits(DigitsAddress(1));
551 SetReconstructionModel(dettype,clf);
558 if(!GetReconstructionModel(dettype)){
559 clf = new AliITSClusterFinderV2SSD(this);
561 if(!rawdata) clf->SetDigits(DigitsAddress(2));
562 SetReconstructionModel(dettype,clf);
569 //______________________________________________________________________
570 void AliITSDetTypeRec::MakeBranch(Option_t* option){
572 //Creates branches for clusters and recpoints
573 Bool_t cR = (strstr(option,"R")!=0);
574 Bool_t cRF = (strstr(option,"RF")!=0);
578 if(cR) MakeBranchR(0);
579 if(cRF) MakeBranchRF(0);
583 //_____________________________________________________________
584 void AliITSDetTypeRec::MakeTreeC(){
586 //Create a separate tree to store the clusters
588 Warning("MakeTreeC","ITS loader is null!");
591 if(fLoader->TreeC()== 0x0) fLoader->MakeTree("C");
595 //______________________________________________________________
596 void AliITSDetTypeRec::MakeBranchC(){
598 //Make branches in the tree of clusters
601 Warning("MakeBranchC","ITS loader is null!");
604 TTree* lTC = fLoader->TreeC();
606 Error("MakeTreeC","Can not get TreeC from loader");
610 Int_t buffersize = 4000;
611 Char_t branchname[30];
613 const char *det[4]={"SPD","SDD","SSD","ITS"};
615 for(Int_t i=0;i<fgkNdettypes;i++){
616 cluclass = GetClusterClassName(i);
617 if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
618 if(!ClustersAddress(i)){
619 fCtype->AddAt(new TClonesArray(cluclass,1000),i);
621 if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
622 else sprintf(branchname,"%sClusters%d",det[3],i+1);
624 if(lTC->GetBranch(branchname)){
625 Warning("MakeBranchC","Branch %s already exists in TreeC",branchname);
627 Info("MakeBranchC","Creating branch %s in TreeC",branchname);
628 lTC->Branch(branchname,&((*fCtype)[i]),buffersize);
636 //_______________________________________________________________
637 void AliITSDetTypeRec::GetTreeC(Int_t event){
639 //Get the clusters tree for this event and
640 //sets the branch address
644 Warning("GetTreeC","ITS loader is null!");
648 Char_t branchname[30];
649 const char *det[4] = {"SPD","SDD","SSD","ITS"};
650 TTree* lTC = fLoader->TreeC();
653 if(lTC) fLoader->CleanRawClusters();
658 for(Int_t i=0;i<fgkNdettypes;i++){
659 cluclass = GetClusterClassName(i);
660 if(fCtype==0x0) fCtype = new TObjArray(fgkNdettypes);
661 if(!fCtype->At(i)) fCtype->AddAt(new TClonesArray(cluclass,1000),i);
662 if(fgkNdettypes==3) sprintf(branchname,"%sClusters%s",det[3],det[i]);
663 else sprintf(branchname,"%sClusters%d",det[3],i+1);
665 branch = lTC->GetBranch(branchname);
666 if(branch) branch->SetAddress(&((*fCtype)[i]));
670 Error("GetTreeC","cannot find clusters Tree for vent %d",event);
675 //___________________________________________________________________
676 void AliITSDetTypeRec::AddCluster(Int_t id, AliITSRawCluster *c){
678 // Adds a raw cluster to the list
679 TClonesArray &lc = *((TClonesArray*)fCtype->At(id));
682 new(lc[fNctype[id]++]) AliITSRawClusterSPD(*((AliITSRawClusterSPD*)c));
685 new(lc[fNctype[id]++]) AliITSRawClusterSDD(*((AliITSRawClusterSDD*)c));
688 new(lc[fNctype[id]++]) AliITSRawClusterSSD(*((AliITSRawClusterSSD*)c));
692 //___________________________________________________________________
693 void AliITSDetTypeRec::ResetDigits(){
694 // Reset number of digits and the digits array for the ITS detector.
697 for(Int_t i=0;i<fgkNdettypes;i++){
701 //___________________________________________________________________
702 void AliITSDetTypeRec::ResetDigits(Int_t branch){
703 // Reset number of digits and the digits array for this branch.
705 if(fDigits->At(branch)) ((TClonesArray*)fDigits->At(branch))->Clear();
706 if(fNdtype) fNdtype[branch]=0;
710 //__________________________________________________________________
711 void AliITSDetTypeRec::ResetClusters(){
713 //Resets number of clusters and the cluster array
714 for(Int_t i=0;i<fgkNdettypes;i++){
719 //__________________________________________________________________
720 void AliITSDetTypeRec::ResetClusters(Int_t i){
722 //Resets number of clusters and the cluster array for this branch
724 if (fCtype->At(i)) ((TClonesArray*)fCtype->At(i))->Clear();
725 if (fNctype) fNctype[i]=0;
727 //__________________________________________________________________
728 void AliITSDetTypeRec::MakeBranchR(const char *file, Option_t *opt){
730 //Creates tree branches for recpoints
732 // cont char *file File name where RecPoints branch is to be written
733 // to. If blank it write the SDigits to the same
734 // file in which the Hits were found.
737 Warning("MakeBranchR","ITS loader is null!");
744 // only one branch for rec points for all detector types
745 Bool_t oFast= (strstr(opt,"Fast")!=0);
747 Char_t detname[10] = "ITS";
751 sprintf(branchname,"%sRecPointsF",detname);
753 sprintf(branchname,"%sRecPoints",detname);
756 if(!fRecPoints)fRecPoints = new TClonesArray("AliITSRecPoint",1000);
757 if (fLoader->TreeR()) {
758 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",
760 MakeBranchInTree(fLoader->TreeR(),branchname,0,&fRecPoints,buffsz,99,file);
765 //______________________________________________________________________
766 void AliITSDetTypeRec::SetTreeAddressR(TTree *treeR){
767 // Set branch address for the Reconstructed points Trees.
769 // TTree *treeR Tree containing the RecPoints.
775 Char_t namedet[10]="ITS";
778 if(fRecPoints==0x0) fRecPoints = new TClonesArray("AliITSRecPoint",1000);
780 sprintf(branchname,"%sRecPoints",namedet);
781 branch = treeR->GetBranch(branchname);
783 branch->SetAddress(&fRecPoints);
785 sprintf(branchname,"%sRecPointsF",namedet);
786 branch = treeR->GetBranch(branchname);
788 branch->SetAddress(&fRecPoints);
793 //____________________________________________________________________
794 void AliITSDetTypeRec::AddRecPoint(const AliITSRecPoint &r){
795 // Add a reconstructed space point to the list
797 // const AliITSRecPoint &r RecPoint class to be added to the tree
798 // of reconstructed points TreeR.
804 TClonesArray &lrecp = *fRecPoints;
805 new(lrecp[fNRecPoints++]) AliITSRecPoint(r);
808 //______________________________________________________________________
809 void AliITSDetTypeRec::DigitsToRecPoints(Int_t evNumber,Int_t lastentry,Option_t *opt, Bool_t v2){
810 // cluster finding and reconstruction of space points
811 // the condition below will disappear when the geom class will be
812 // initialized for all versions - for the moment it is only for v5 !
813 // 7 is the SDD beam test version
815 // Int_t evNumber Event number to be processed.
816 // Int_t lastentry Offset for module when not all of the modules
818 // Option_t *opt String indicating which ITS sub-detectors should
819 // be processed. If ="All" then all of the ITS
820 // sub detectors are processed.
823 Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
827 Warning("DigitsToRecPoints","ITS loader is null!");
831 const char *all = strstr(opt,"All");
832 const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
835 SetDefaultClusterFinders();
836 AliInfo("Original cluster finder has been selected\n");
839 SetDefaultClusterFindersV2();
840 AliInfo("V2 cluster finder has been selected \n");
843 TTree *treeC=fLoader->TreeC();
848 AliITSClusterFinder *rec = 0;
849 Int_t id,module,first=0;
850 for(module=0;module<GetITSgeom()->GetIndexMax();module++){
851 id = GetITSgeom()->GetModuleType(module);
852 if (!all && !det[id]) continue;
853 if(det[id]) first = GetITSgeom()->GetStartDet(id);
854 rec = (AliITSClusterFinder*)GetReconstructionModel(id);
855 TClonesArray *itsDigits = DigitsAddress(id);
857 Error("DigitsToRecPoints",
858 "The reconstruction class was not instanciated! event=%d",
863 TTree *lTD = fLoader->TreeD();
865 lTD->GetEvent(lastentry+module);
867 lTD->GetEvent(lastentry+(module-first));
869 Int_t ndigits = itsDigits->GetEntriesFast();
871 rec->SetDetTypeRec(this);
872 rec->SetDigits(DigitsAddress(id));
873 rec->SetClusters(ClustersAddress(id));
874 rec->FindRawClusters(module);
876 fLoader->TreeR()->Fill();
882 fLoader->WriteRecPoints("OVERWRITE");
883 fLoader->WriteRawClusters("OVERWRITE");
885 //______________________________________________________________________
886 void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader){
887 // cluster finding and reconstruction of space points
888 // the condition below will disappear when the geom class will be
889 // initialized for all versions - for the moment it is only for v5 !
890 // 7 is the SDD beam test version
892 // Int_t evNumber Event number to be processed.
893 // Int_t lastentry Offset for module when not all of the modules
895 // Option_t *opt String indicating which ITS sub-detectors should
896 // be processed. If ="All" then all of the ITS
897 // sub detectors are processed.
903 Warning("DigitsToRecPoints","Null pointer to AliITSgeom !");
907 Warning("DigitsToRecPoints","ITS loader is null!");
912 AliITSClusterFinderV2 *rec = 0;
915 if(!fLoader->TreeR()) fLoader->MakeTree("R");
916 TTree* cTree = fLoader->TreeR();
917 TClonesArray *array=new TClonesArray("AliITSRecPoint",1000);
918 cTree->Branch("ITSRecPoints",&array);
921 TClonesArray** clusters = new TClonesArray*[GetITSgeom()->GetIndexMax()];
922 for (Int_t iModule = 0; iModule < GetITSgeom()->GetIndexMax(); iModule++) {
923 clusters[iModule] = NULL;
926 rec = (AliITSClusterFinderV2*)GetReconstructionModel(id);
927 rec->SetDetTypeRec(this);
929 Error("DigitsToRecPoints",
930 "The reconstruction class was not instanciated");
933 rec->RawdataToClusters(rawReader,clusters);
936 for(Int_t iModule=0;iModule<GetITSgeom()->GetIndexMax();iModule++){
937 array = clusters[iModule];
939 Error("DigitsToRecPoints","data for module %d missing!",iModule);
940 array = new TClonesArray("AliITSRecPoint");
942 cTree->SetBranchAddress("ITSRecPoints",&array);
944 nClusters+=array->GetEntriesFast();
947 fLoader->WriteRecPoints("OVERWRITE");
950 Info("DigitsToRecPoints", "total number of found recpoints in ITS: %d\n",