diff --git a/TPC/TPCcalib/AliTPCDcalibRes.cxx b/TPC/TPCcalib/AliTPCDcalibRes.cxx index f8c23f42d53..8486cd37113 100644 --- a/TPC/TPCcalib/AliTPCDcalibRes.cxx +++ b/TPC/TPCcalib/AliTPCDcalibRes.cxx @@ -78,6 +78,7 @@ AliTPCDcalibRes::AliTPCDcalibRes(int run,Long64_t tmin,Long64_t tmax,const char* ,fChebCorr(0) ,fRun(run) + ,fExtDet(kUseTRDonly) ,fTMin(tmin) ,fTMax(tmax) ,fTMinGRP(0) @@ -205,6 +206,18 @@ AliTPCDcalibRes::~AliTPCDcalibRes() delete fTracksRate; } +//________________________________________ +void AliTPCDcalibRes::SetExternalDetectors(int det) +{ + // set external detectos choice + if (det<0 || det>=kNExtDetComb) { + AliErrorF("Invalid external detector %d, allowed range 0:%d, see header file enum{...kNExtDetComb}",det,kNExtDetComb-1); + return; + } + fExtDet = det; +} + + //________________________________________ void AliTPCDcalibRes::ProcessFromDeltaTrees() { @@ -388,10 +401,10 @@ void AliTPCDcalibRes::CollectData(int mode) if (!fInitDone) Init(); if (!AliGeomManager::GetGeometry()) InitGeom(); // in case started from saved object // gEnv->SetValue("TFile.AsyncPrefetching", 1); - TVectorF *vecDY=0,*vecDZ=0,*vecZ=0,*vecR=0,*vecSec=0,*vecPhi=0, *vecDYITS=0,*vecDZITS=0; + TVectorF *vecDYTRD=0,*vecDZTRD=0,*vecDYITS=0,*vecDZITS=0,*vecDYTOF=0,*vecDZTOF=0,*vecZ=0,*vecR=0,*vecSec=0,*vecPhi=0; UShort_t npValid = 0; Int_t nPrimTracks = 0; - Char_t trdOK=0,tofOK=0; + Char_t trdOK=0,tofOK=0,itsOK=0; Double_t tofBC = 0.0; AliExternalTrackParam* param = 0; // @@ -412,7 +425,10 @@ void AliTPCDcalibRes::CollectData(int mode) Int_t nChunks = chunkArray->GetEntriesFast(); // AliSysInfo::AddStamp("ProjInit",0,0,0,0); - + // + Bool_t needTRD = fExtDet==kUseTRDorTOF || fExtDet==kUseTRDonly; + Bool_t needTOF = fExtDet==kUseTRDorTOF || fExtDet==kUseTOFonly; + // for (int ichunk=0;ichunkSetBranchStatus("*",kFALSE); if (fNPrimTracksCut>0) tree->SetBranchStatus("nPrimTracks",kTRUE); tree->SetBranchStatus("timeStamp",kTRUE); + tree->SetBranchStatus("itsOK",kTRUE); tree->SetBranchStatus("trdOK",kTRUE); + tree->SetBranchStatus("tofOK",kTRUE); tree->SetBranchStatus("vecR.",kTRUE); tree->SetBranchStatus("vecSec.",kTRUE); tree->SetBranchStatus("vecPhi.",kTRUE); tree->SetBranchStatus("vecZ.",kTRUE); tree->SetBranchStatus("track.*",kTRUE); tree->SetBranchStatus("npValid",kTRUE); - tree->SetBranchStatus("trd0.",kTRUE); - tree->SetBranchStatus("trd1.",kTRUE); tree->SetBranchStatus("its0.",kTRUE); tree->SetBranchStatus("its1.",kTRUE); // tree->SetBranchAddress("timeStamp",&fTimeStamp); + tree->SetBranchAddress("itsOK",&itsOK); tree->SetBranchAddress("trdOK",&trdOK); + tree->SetBranchAddress("tofOK",&tofOK); if (fNPrimTracksCut>0) tree->SetBranchAddress("nPrimTracks",&nPrimTracks); tree->SetBranchAddress("vecR.",&vecR); tree->SetBranchAddress("vecSec.",&vecSec); @@ -453,15 +471,24 @@ void AliTPCDcalibRes::CollectData(int mode) tree->SetBranchAddress("vecZ.",&vecZ); tree->SetBranchAddress("track.",¶m); tree->SetBranchAddress("npValid",&npValid); - tree->SetBranchAddress("trd0.",&vecDY); - tree->SetBranchAddress("trd1.",&vecDZ); tree->SetBranchAddress("its0.",&vecDYITS); tree->SetBranchAddress("its1.",&vecDZITS); // + if (needTRD) { + tree->SetBranchStatus("trd0.",kTRUE); + tree->SetBranchStatus("trd1.",kTRUE); + tree->SetBranchAddress("trd0.",&vecDYTRD); + tree->SetBranchAddress("trd1.",&vecDZTRD); + } + if (needTOF) { + tree->SetBranchStatus("tof0.",kTRUE); + tree->SetBranchStatus("tof1.",kTRUE); + tree->SetBranchAddress("tof0.",&vecDYTOF); + tree->SetBranchAddress("tof1.",&vecDZTOF); + } + // if (fUseTOFBC) { - tree->SetBranchStatus("tofOK",kTRUE); tree->SetBranchStatus("tofBC",kTRUE); - tree->SetBranchAddress("tofOK",&tofOK); tree->SetBranchAddress("tofBC",&tofBC); } // @@ -470,11 +497,10 @@ void AliTPCDcalibRes::CollectData(int mode) TBranch* brTime = tree->GetBranch("timeStamp"); TBranch* brTRDOK = tree->GetBranch("trdOK"); - TBranch* brTOFOK=0, *brTOFBC=0; - if (fUseTOFBC) { - brTOFOK = tree->GetBranch("tofOK"); - brTOFBC = tree->GetBranch("tofBC"); - } + TBranch* brTOFOK = tree->GetBranch("tofOK"); + TBranch* brITSOK = tree->GetBranch("itsOK"); + TBranch* brTOFBC = 0; + if (fUseTOFBC) brTOFBC = tree->GetBranch("tofBC"); // int nTracks = tree->GetEntries(); AliInfoF("Processing %d tracks of %s",nTracks,fileNameString.Data()); @@ -494,10 +520,14 @@ void AliTPCDcalibRes::CollectData(int mode) continue; } // + brITSOK->GetEntry(itr); brTRDOK->GetEntry(itr); - if (!trdOK) continue; + brTOFOK->GetEntry(itr); + if (!itsOK) continue; + if (!trdOK && fExtDet==kUseTRDonly) continue; + if (!tofOK && fExtDet==kUseTOFonly) continue; + if (!tofOK && !trdOK && fExtDet!=kUseITSonly) continue; // - if (brTOFOK && brTOFOK->GetEntry(itr) && !tofOK) continue; if (brTOFBC && brTOFBC->GetEntry(itr) && (tofBCfTOFBCMax)) continue; // if (!lastReadMatched && fSwitchCache) { // reset the cache before switching to event reading mode @@ -516,11 +546,23 @@ void AliTPCDcalibRes::CollectData(int mode) const Float_t *vPhi= vecPhi->GetMatrixArray(); const Float_t *vR = vecR->GetMatrixArray(); const Float_t *vZ = vecZ->GetMatrixArray(); - const Float_t *vDY = vecDY->GetMatrixArray(); - const Float_t *vDZ = vecDZ->GetMatrixArray(); const Float_t *vDYITS = vecDYITS->GetMatrixArray(); const Float_t *vDZITS = vecDZITS->GetMatrixArray(); // + const Float_t *vDY=0,*vDZ = 0; + if (fExtDet==kUseTRDonly || (fExtDet==kUseTRDorTOF && trdOK)) { + vDY = vecDYTRD->GetMatrixArray(); + vDZ = vecDZTRD->GetMatrixArray(); + } + else if (fExtDet==kUseITSonly) { // ignore other detectos + vDY = vecDYITS->GetMatrixArray(); + vDZ = vecDZITS->GetMatrixArray(); + } + else { // only TOF + vDY = vecDYTOF->GetMatrixArray(); + vDZ = vecDZTOF->GetMatrixArray(); + } + // fCorrTime = (fVDriftGraph!=NULL) ? fVDriftGraph->Eval(fTimeStamp):0; // for VDrift correction // fNCl = 0; diff --git a/TPC/TPCcalib/AliTPCDcalibRes.h b/TPC/TPCcalib/AliTPCDcalibRes.h index 28db14c0e61..333a698fe2a 100644 --- a/TPC/TPCcalib/AliTPCDcalibRes.h +++ b/TPC/TPCcalib/AliTPCDcalibRes.h @@ -40,6 +40,7 @@ class AliTPCDcalibRes: public TNamed enum {kAlignmentBugFixedBit = AliTPCcalibAlignInterpolation::kAlignmentBugFixedBit}; enum {kExtractMode, kClosureTestMode}; enum {kDistDone=BIT(0),kDispDone=BIT(1),kSmoothDone=BIT(2),kKilled=BIT(7)}; + enum {kUseTRDonly,kUseTOFonly,kUseITSonly,kUseTRDorTOF,kNExtDetComb}; // which points to use // the voxels are defined in following space enum {kVoxZ, // Z/X sector coordinates @@ -293,6 +294,9 @@ class AliTPCDcalibRes: public TNamed Float_t GetMaxRMSLong() const {return fMaxRMSLong;} Float_t GetMaxRejFrac() const {return fMaxRejFrac;} Bool_t GetFilterOutliers() const {return fFilterOutliers;} + Int_t GetExternalDetectors() const {return fExtDet;} + void SetExternalDetectors(int det=kUseTRDonly); + // void SetChebZSlicePerSide(int n=1) {fChebZSlicePerSide = n;} void SetChebPhiSlicePerSector(int n=1) {fChebPhiSlicePerSector = n;} @@ -331,6 +335,7 @@ class AliTPCDcalibRes: public TNamed AliTPCChebCorr* fChebCorr; // final Chebyshev object // -------------------------------Task defintion Int_t fRun; // run number + Int_t fExtDet; // external detectors to use Long64_t fTMin; // time start for timebin Long64_t fTMax; // time stop for timebin Long64_t fTMinGRP; // time start from GRP @@ -478,7 +483,7 @@ class AliTPCDcalibRes: public TNamed static const Float_t kTPCRowX[]; // X of the pad-row static const Float_t kTPCRowDX[]; // pitch in X - ClassDef(AliTPCDcalibRes,7); + ClassDef(AliTPCDcalibRes,8); }; //________________________________________________________________