#include <TRandom.h>
#include <TTreeStream.h>
#include <TVector3.h>
+#include <TBits.h>
#include "AliLog.h"
#include "AliGeomManager.h"
fITSChannelStatus(0),
fkDetTypeRec(0),
fPlaneEff(0),
+fSPDChipIntPlaneEff(0),
fITSPid(0)
{
fITSChannelStatus(0),
fkDetTypeRec(0),
fPlaneEff(0),
+fSPDChipIntPlaneEff(0),
fITSPid(0) {
//--------------------------------------------------------------------
//This is the AliITStrackerMI constructor
Int_t iplane=AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff();
if(!AliITSReconstructor::GetRecoParam()->GetLayersToSkip(iplane)==1)
AliWarning(Form("Evaluation of Plane Eff for layer %d will be attempted without removing it from tracker",iplane));
- if (iplane<2) fPlaneEff = new AliITSPlaneEffSPD();
+ if (iplane<2) {
+ fPlaneEff = new AliITSPlaneEffSPD();
+ fSPDChipIntPlaneEff = new Bool_t[AliITSPlaneEffSPD::kNModule*AliITSPlaneEffSPD::kNChip];
+ for (UInt_t i=0; i<AliITSPlaneEffSPD::kNModule*AliITSPlaneEffSPD::kNChip; i++) fSPDChipIntPlaneEff[i]=kFALSE;
+ }
else if (iplane<4) fPlaneEff = new AliITSPlaneEffSDD();
else fPlaneEff = new AliITSPlaneEffSSD();
if(AliITSReconstructor::GetRecoParam()->GetReadPlaneEffFromOCDB())
if(fITSChannelStatus) delete fITSChannelStatus;
if(fPlaneEff) delete fPlaneEff;
if(fITSPid) delete fITSPid;
+ if (fSPDChipIntPlaneEff) delete [] fSPDChipIntPlaneEff;
}
//------------------------------------------------------------------------
Int_t nentr=event->GetNumberOfTracks();
// Info("RefitInward", "Number of ESD tracks: %d\n", nentr);
+ // only for PlaneEff and in case of SPD (for FO studies)
+ if( AliITSReconstructor::GetRecoParam()->GetComputePlaneEff() &&
+ AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()>=0 &&
+ AliITSReconstructor::GetRecoParam()->GetIPlanePlaneEff()<2) {
+ for (UInt_t i=0; i<AliITSPlaneEffSPD::kNModule*AliITSPlaneEffSPD::kNChip; i++) fSPDChipIntPlaneEff[i]=kFALSE;
+ }
+
Int_t ntrk=0;
for (Int_t i=0; i<nentr; i++) {
AliESDtrack *esd=event->GetTrack(i);
}
if(!fPlaneEff->UpDatePlaneEff(found,key))
AliWarning(Form("UseTrackForPlaneEff: cannot UpDate PlaneEff for key=%d",key));
+
+// this for FO efficiency studies (only for SPD) //
+ UInt_t keyFO=999999;
+ Bool_t foundFO=kFALSE;
+ if(ilayer<2){ //ONLY SPD layers for FastOr studies
+ TBits mapFO = fkDetTypeRec->GetFastOrFiredMap();
+ Int_t phase = (fEsd->GetBunchCrossNumber())%4;
+ if(!fSPDChipIntPlaneEff[key]){
+ AliITSPlaneEffSPD spd;
+ keyFO = spd.SwitchChipKeyNumbering(key);
+ if(mapFO.TestBitNumber(keyFO))foundFO=kTRUE;
+ keyFO = key + (AliITSPlaneEffSPD::kNModule*AliITSPlaneEffSPD::kNChip)*(phase+1);
+ if(keyFO<AliITSPlaneEffSPD::kNModule*AliITSPlaneEffSPD::kNChip) {
+ AliWarning(Form("UseTrackForPlaneEff: too small keyF0 (= %d), setting it to 999999",keyFO));
+ keyFO=999999;
+ }
+ if(!fPlaneEff->UpDatePlaneEff(foundFO,keyFO))
+ AliWarning(Form("UseTrackForPlaneEff: cannot UpDate PlaneEff for FastOR for key=%d",keyFO));
+ }
+ }
+
+
+
if(fPlaneEff->GetCreateHistos()&& AliITSReconstructor::GetRecoParam()->GetHistoPlaneEff()) {
Float_t tr[4]={99999.,99999.,9999.,9999.}; // initialize to high values
Float_t clu[4]={-99999.,-99999.,9999.,9999.}; // (in some cases GetCov fails)
AngleModTrack[1]-=TMath::Pi()/2.; // range of angle is -pi/2 , pi/2
AngleModTrack[1]*=180./TMath::Pi(); // in degree
- fPlaneEff->FillHistos(key,found,tr,clu,cltype,AngleModTrack);
+ fPlaneEff->FillHistos(key,found,tr,clu,cltype,AngleModTrack);
+
+ // For FO efficiency studies of SPD
+ if(ilayer<2 && !fSPDChipIntPlaneEff[key]) fPlaneEff->FillHistos(keyFO,foundFO,tr,clu,cltype,AngleModTrack);
}
+ if(ilayer<2) fSPDChipIntPlaneEff[key]=kTRUE;
return;
}