Skip to content

Commit

Permalink
Possibility to select which external detector interpolation to use
Browse files Browse the repository at this point in the history
The choices are:
AliTPCDcalibRes::kUseTRDonly (default)
AliTPCDcalibRes::kUseTOFonly,AliTPCDcalibRes::kUseITSonly(no external detector),kUseTRDorTOF(use TRD then TOF depending on availability)
  • Loading branch information
shahor02 committed May 20, 2016
1 parent a9e4373 commit c477b1d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 19 deletions.
78 changes: 60 additions & 18 deletions TPC/TPCcalib/AliTPCDcalibRes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
//
Expand All @@ -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;ichunk<nChunks;ichunk++) {
//
int ntrSelChunkWO=0, ntrSelChunk=0,nReadCallsChunk=0,nBytesReadChunk=0;
Expand All @@ -432,36 +448,47 @@ void AliTPCDcalibRes::CollectData(int mode)
tree->SetBranchStatus("*",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);
tree->SetBranchAddress("vecPhi.",&vecPhi);
tree->SetBranchAddress("vecZ.",&vecZ);
tree->SetBranchAddress("track.",&param);
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);
}
//
Expand All @@ -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());
Expand All @@ -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) && (tofBC<fTOFBCMin || tofBC>fTOFBCMax)) continue;
//
if (!lastReadMatched && fSwitchCache) { // reset the cache before switching to event reading mode
Expand All @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion TPC/TPCcalib/AliTPCDcalibRes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
};

//________________________________________________________________
Expand Down

0 comments on commit c477b1d

Please sign in to comment.