#include <TFile.h>
#include <TTree.h>
#include <TParticle.h>
+#include <TParticlePDG.h>
#include <TSystem.h>
#include <Riostream.h>
#include <TClonesArray.h>
-#include "AliITSMultReconstructor.h"
+#include "AliTracker.h"
#include "AliITSTrackleterSPDEff.h"
#include "AliITSgeomTGeo.h"
#include "AliLog.h"
#include "AliITSPlaneEffSPD.h"
#include "AliStack.h"
#include "AliTrackReference.h"
-
+#include "AliRunLoader.h"
+#include "AliITSReconstructor.h"
+#include "AliITSRecPoint.h"
+#include "AliESDEvent.h"
+#include "AliESDVertex.h"
//____________________________________________________________________
ClassImp(AliITSTrackleterSPDEff)
//____________________________________________________________________
AliITSTrackleterSPDEff::AliITSTrackleterSPDEff():
-AliITSMultReconstructor(),
+AliTracker(),
+//
+fClustersLay1(0),
+fClustersLay2(0),
+fTracklets(0),
+fAssociationFlag(0),
+fNClustersLay1(0),
+fNClustersLay2(0),
+fNTracklets(0),
+fOnlyOneTrackletPerC2(0),
+fPhiWindowL2(0),
+fZetaWindowL2(0),
+fPhiOverlapCut(0),
+fZetaOverlapCut(0),
+fHistOn(0),
+fhClustersDPhiAcc(0),
+fhClustersDThetaAcc(0),
+fhClustersDZetaAcc(0),
+fhClustersDPhiAll(0),
+fhClustersDThetaAll(0),
+fhClustersDZetaAll(0),
+fhDPhiVsDThetaAll(0),
+fhDPhiVsDThetaAcc(0),
+fhDPhiVsDZetaAll(0),
+fhDPhiVsDZetaAcc(0),
+fhetaTracklets(0),
+fhphiTracklets(0),
+fhetaClustersLay1(0),
+fhphiClustersLay1(0),
+//
fAssociationFlag1(0),
fChipPredOnLay2(0),
fChipPredOnLay1(0),
fZetaWindowL1(0),
fOnlyOneTrackletPerC1(0),
fUpdateOncePerEventPlaneEff(0),
+fMinContVtx(0),
fChipUpdatedInEvent(0),
fPlaneEffSPD(0),
+fPlaneEffBkg(0),
fReflectClusterAroundZAxisForLayer0(kFALSE),
fReflectClusterAroundZAxisForLayer1(kFALSE),
+fLightBkgStudyInParallel(kFALSE),
fMC(0),
fUseOnlyPrimaryForPred(0),
fUseOnlySecondaryForPred(0),
fUseOnlySameParticle(0),
fUseOnlyDifferentParticle(0),
-fUseOnlyStableParticle(0),
+fUseOnlyStableParticle(1),
fPredictionPrimary(0),
fPredictionSecondary(0),
fClusterPrimary(0),
fhDPhiVsDZetaInterpAll(0),
fhDPhiVsDZetaInterpAcc(0),
fhetaClustersLay2(0),
-fhphiClustersLay2(0)
+fhphiClustersLay2(0),
+fhClustersInChip(0),
+fhClustersInModuleLay1(0),
+fhClustersInModuleLay2(0)
{
// default constructor
-
+// from AliITSMultReconstructor
+ SetPhiWindowL2();
+ SetZetaWindowL2();
+ SetOnlyOneTrackletPerC2();
+ fClustersLay1 = new Float_t*[300000];
+ fClustersLay2 = new Float_t*[300000];
+ fTracklets = new Float_t*[300000];
+ fAssociationFlag = new Bool_t[300000];
+//
SetPhiWindowL1();
SetZetaWindowL1();
SetOnlyOneTrackletPerC1();
fChipUpdatedInEvent = new Bool_t[1200];
for(Int_t i=0; i<300000; i++) {
+ // from AliITSMultReconstructor
+ fClustersLay1[i] = new Float_t[6];
+ fClustersLay2[i] = new Float_t[6];
+ fTracklets[i] = new Float_t[5];
+ fAssociationFlag[i] = kFALSE;
+ //
fAssociationFlag1[i] = kFALSE;
}
for(Int_t i=0;i<1200; i++) fChipUpdatedInEvent[i] = kFALSE;
if (GetHistOn()) BookHistos();
fPlaneEffSPD = new AliITSPlaneEffSPD();
+ SetLightBkgStudyInParallel();
}
//______________________________________________________________________
-AliITSTrackleterSPDEff::AliITSTrackleterSPDEff(const AliITSTrackleterSPDEff &mr) : AliITSMultReconstructor(mr),
+AliITSTrackleterSPDEff::AliITSTrackleterSPDEff(const AliITSTrackleterSPDEff &mr) :
+AliTracker(mr),
+// from AliITSMultReconstructor
+fClustersLay1(mr.fClustersLay1),
+fClustersLay2(mr.fClustersLay2),
+fTracklets(mr.fTracklets),
+fAssociationFlag(mr.fAssociationFlag),
+fNClustersLay1(mr.fNClustersLay1),
+fNClustersLay2(mr.fNClustersLay2),
+fNTracklets(mr.fNTracklets),
+fOnlyOneTrackletPerC2(mr.fOnlyOneTrackletPerC2),
+fPhiWindowL2(mr.fPhiWindowL2),
+fZetaWindowL2(mr.fZetaWindowL2),
+fPhiOverlapCut(mr.fPhiOverlapCut),
+fZetaOverlapCut(mr.fZetaOverlapCut),
+fHistOn(mr.fHistOn),
+fhClustersDPhiAcc(mr.fhClustersDPhiAcc),
+fhClustersDThetaAcc(mr.fhClustersDThetaAcc),
+fhClustersDZetaAcc(mr.fhClustersDZetaAcc),
+fhClustersDPhiAll(mr.fhClustersDPhiAll),
+fhClustersDThetaAll(mr.fhClustersDThetaAll),
+fhClustersDZetaAll(mr.fhClustersDZetaAll),
+fhDPhiVsDThetaAll(mr.fhDPhiVsDThetaAll),
+fhDPhiVsDThetaAcc(mr.fhDPhiVsDThetaAcc),
+fhDPhiVsDZetaAll(mr.fhDPhiVsDZetaAll),
+fhDPhiVsDZetaAcc(mr.fhDPhiVsDZetaAcc),
+fhetaTracklets(mr.fhetaTracklets),
+fhphiTracklets(mr.fhphiTracklets),
+fhetaClustersLay1(mr.fhetaClustersLay1),
+fhphiClustersLay1(mr.fhphiClustersLay1),
+//
fAssociationFlag1(mr.fAssociationFlag1),
fChipPredOnLay2(mr.fChipPredOnLay2),
fChipPredOnLay1(mr.fChipPredOnLay1),
fZetaWindowL1(mr.fZetaWindowL1),
fOnlyOneTrackletPerC1(mr.fOnlyOneTrackletPerC1),
fUpdateOncePerEventPlaneEff(mr.fUpdateOncePerEventPlaneEff),
+fMinContVtx(mr.fMinContVtx),
fChipUpdatedInEvent(mr.fChipUpdatedInEvent),
fPlaneEffSPD(mr.fPlaneEffSPD),
+fPlaneEffBkg(mr.fPlaneEffBkg),
fReflectClusterAroundZAxisForLayer0(mr.fReflectClusterAroundZAxisForLayer0),
fReflectClusterAroundZAxisForLayer1(mr.fReflectClusterAroundZAxisForLayer1),
+fLightBkgStudyInParallel(mr.fLightBkgStudyInParallel),
fMC(mr.fMC),
fUseOnlyPrimaryForPred(mr.fUseOnlyPrimaryForPred),
fUseOnlySecondaryForPred(mr.fUseOnlySecondaryForPred),
fhDPhiVsDZetaInterpAll(mr.fhDPhiVsDZetaInterpAll),
fhDPhiVsDZetaInterpAcc(mr.fhDPhiVsDZetaInterpAcc),
fhetaClustersLay2(mr.fhetaClustersLay2),
-fhphiClustersLay2(mr.fhphiClustersLay2)
+fhphiClustersLay2(mr.fhphiClustersLay2),
+fhClustersInChip(mr.fhClustersInChip),
+fhClustersInModuleLay1(mr.fhClustersInModuleLay1),
+fhClustersInModuleLay2(mr.fhClustersInModuleLay2)
{
// Copy constructor
}
//______________________________________________________________________
AliITSTrackleterSPDEff::~AliITSTrackleterSPDEff(){
// Destructor
-
+// from AliITSMultReconstructor
+ // delete arrays
+ for(Int_t i=0; i<300000; i++) {
+ delete [] fClustersLay1[i];
+ delete [] fClustersLay2[i];
+ delete [] fTracklets[i];
+ }
+ delete [] fClustersLay1;
+ delete [] fClustersLay2;
+ delete [] fTracklets;
+ delete [] fAssociationFlag;
+//
// delete histograms
DeleteHistos();
// delete PlaneEff
delete fPlaneEffSPD;
+ fPlaneEffSPD=0;
+ if(fPlaneEffBkg) {
+ delete fPlaneEffBkg;
+ fPlaneEffBkg=0;
+
+ }
}
//____________________________________________________________________
void
-AliITSTrackleterSPDEff::Reconstruct(TTree* clusterTree, Float_t* vtx, Float_t*, AliStack *pStack, TTree *tRef) {
+AliITSTrackleterSPDEff::Reconstruct(AliStack *pStack, TTree *tRef, Bool_t lbkg) {
//
- // - calls LoadClusterArray that finds the position of the clusters
- // (in global coord)
- // - convert the cluster coordinates to theta, phi (seen from the
- // interaction vertex). Find the extrapolation/interpolation point.
+ // - you have to take care of the following, before of using Reconstruct
+ // 1) call LoadClusters(TTree* cl) that finds the position of the clusters (in global coord)
+ // and convert the cluster coordinates to theta, phi (seen from the
+ // interaction vertex).
+ // 2) call SetVertex(vtxPos, vtxErr) which set the position of the vertex
+ // - Find the extrapolation/interpolation point.
// - Find the chip corresponding to that
// - Check if there is a cluster near that point
//
-
// reset counters
- fNClustersLay1 = 0;
- fNClustersLay2 = 0;
+ if(lbkg && !GetLightBkgStudyInParallel()) {
+ AliError("You asked for lightBackground in the Reconstruction without proper call to SetLightBkgStudyInParallel(1)");
+ return;
+ }
+ AliITSPlaneEffSPD *pe;
+ if(lbkg) {
+ pe=fPlaneEffBkg;
+ } else {
+ pe=fPlaneEffSPD;
+ }
fNTracklets = 0;
- fNSingleCluster = 0;
- // loading the clusters
- LoadClusterArrays(clusterTree);
+ // retrieve the vertex position
+ Float_t vtx[3];
+ vtx[0]=(Float_t)GetX();
+ vtx[1]=(Float_t)GetY();
+ vtx[2]=(Float_t)GetZ();
// to study residual background (i.e. contribution from TT' to measured efficiency)
- if(fReflectClusterAroundZAxisForLayer0) ReflectClusterAroundZAxisForLayer(0);
- if(fReflectClusterAroundZAxisForLayer1) ReflectClusterAroundZAxisForLayer(1);
+ if(fReflectClusterAroundZAxisForLayer0 && !lbkg) ReflectClusterAroundZAxisForLayer(0);
+ if(fReflectClusterAroundZAxisForLayer1 && !lbkg) ReflectClusterAroundZAxisForLayer(1);
//
- if(fMC && !pStack) {AliError("You asked for MC infos but AliStack not properly loaded"); return;}
- if(fMC && !tRef) {AliError("You asked for MC infos but TrackRef Tree not properly loaded"); return;}
+ if(fMC && !pStack && !lbkg) {AliError("You asked for MC infos but AliStack not properly loaded"); return;}
+ if(fMC && !tRef && !lbkg) {AliError("You asked for MC infos but TrackRef Tree not properly loaded"); return;}
Bool_t found;
Int_t nfTraPred1=0; Int_t ntTraPred1=0;
Int_t nfTraPred2=0; Int_t ntTraPred2=0;
fChipPredOnLay2[iC1] = key;
fAssociationFlag1[iC1] = kFALSE;
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
Float_t eta=fClustersLay1[iC1][0];
eta= TMath::Tan(eta/2.);
eta=-TMath::Log(eta);
- fhetaClustersLay1->Fill(eta);
+ fhetaClustersLay1->Fill(eta);
fhphiClustersLay1->Fill(fClustersLay1[iC1][1]);
+ fhClustersInChip->Fill(fhClustersInChip->GetBinCenter(key+1)); // if found=kFALSE -> overflow
}
}
// Loop on layer 2 : finding theta, phi and r
fChipPredOnLay1[iC2] = key;
fAssociationFlag[iC2] = kFALSE;
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
Float_t eta=fClustersLay2[iC2][0];
eta= TMath::Tan(eta/2.);
eta=-TMath::Log(eta);
fhetaClustersLay2->Fill(eta);
fhphiClustersLay2->Fill(fClustersLay2[iC2][1]);
+ fhClustersInChip->Fill(fhClustersInChip->GetBinCenter(key+1)); // if found=kFALSE -> overflow
}
}
// in any case, if MC has been required, store statistics of primaries and secondaries
Bool_t primary=kFALSE; Bool_t secondary=kFALSE; // it is better to have both since chip might not be found
- if (fMC) {
+ if (fMC && !lbkg) {
Int_t lab1=(Int_t)fClustersLay1[iC1][3];
Int_t lab2=(Int_t)fClustersLay1[iC1][4];
Int_t lab3=(Int_t)fClustersLay1[iC1][5];
Float_t r2 = fClustersLay2[iC2][2]/TMath::Cos(fClustersLay2[iC2][0]);
Float_t dZeta = TMath::Cos(fClustersLay1[iC1][0])*r2 - fClustersLay2[iC2][2];
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
fhClustersDPhiAll->Fill(dPhi);
fhClustersDThetaAll->Fill(dTheta);
fhClustersDZetaAll->Fill(dZeta);
}
// make "elliptical" cut in Phi and Zeta!
- Float_t d = TMath::Sqrt(dPhi*dPhi/fPhiWindow/fPhiWindow +
- dZeta*dZeta/fZetaWindow/fZetaWindow);
+ Float_t d = TMath::Sqrt(dPhi*dPhi/fPhiWindowL2/fPhiWindowL2 +
+ dZeta*dZeta/fZetaWindowL2/fZetaWindowL2);
if (d>1) continue;
if (distmin<100) { // This means that a cluster in layer 2 was found that matches with iC1
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
fhClustersDPhiAcc->Fill(dPhimin);
fhClustersDThetaAcc->Fill(dThetamin);
fhClustersDZetaAcc->Fill(dZetamin);
fTracklets[fNTracklets][3] = -2;
}
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
Float_t eta=fTracklets[fNTracklets][0];
eta= TMath::Tan(eta/2.);
eta=-TMath::Log(eta);
nfClu2+=(Int_t)found; // this for debugging purpose
ntClu2++; // to check efficiency of the method FindChip
if(key<1200) { // the Chip has been found
- if(fMC) { // this part only for MC
+ if(fMC && !lbkg) { // this part only for MC
// Int_t labc1=(Int_t)fClustersLay2[iC2WithBestDist][3];
// Int_t labc2=(Int_t)fClustersLay2[iC2WithBestDist][4];
// Int_t labc3=(Int_t)fClustersLay2[iC2WithBestDist][5];
if (key==fChipPredOnLay2[iC1]) { // this control seems too loose: has to be checked !
// OK, success
- fPlaneEffSPD->UpDatePlaneEff(kTRUE,key); // success
+ pe->UpDatePlaneEff(kTRUE,key); // success
fChipUpdatedInEvent[key]=kTRUE;
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fSuccessP[key]++;
if(secondary) fSuccessS[key]++;
}
}
else {
- fPlaneEffSPD->UpDatePlaneEff(kTRUE,key); // this should not be a failure
+ pe->UpDatePlaneEff(kTRUE,key); // this should not be a failure
fChipUpdatedInEvent[key]=kTRUE; // (might be in the tracking tollerance)
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fSuccessP[key]++;
if(secondary) fSuccessS[key]++;
}
} // if any cluster found --> increment statistics by 1 failure (provided you have chip prediction)
else if (fChipPredOnLay2[iC1]<1200) {
- fPlaneEffSPD->UpDatePlaneEff(kFALSE,fChipPredOnLay2[iC1]);
+ pe->UpDatePlaneEff(kFALSE,fChipPredOnLay2[iC1]);
fChipUpdatedInEvent[fChipPredOnLay2[iC1]]=kTRUE;
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fFailureP[fChipPredOnLay2[iC1]]++;
if(secondary) fFailureS[fChipPredOnLay2[iC1]]++;
}
// in any case, if MC has been required, store statistics of primaries and secondaries
Bool_t primary=kFALSE; Bool_t secondary=kFALSE;
- if (fMC) {
+ if (fMC && !lbkg) {
Int_t lab1=(Int_t)fClustersLay2[iC2][3];
Int_t lab2=(Int_t)fClustersLay2[iC2][4];
Int_t lab3=(Int_t)fClustersLay2[iC2][5];
Float_t dZeta = TMath::Cos(fClustersLay2[iC2][0])*r1 - fClustersLay1[iC1][2];
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
fhClustersDPhiInterpAll->Fill(dPhi);
fhClustersDThetaInterpAll->Fill(dTheta);
fhClustersDZetaInterpAll->Fill(dZeta);
if (distmin<100) { // This means that a cluster in layer 1 was found that matches with iC2
- if (fHistOn) {
+ if (fHistOn && !lbkg) {
fhClustersDPhiInterpAcc->Fill(dPhimin);
fhClustersDThetaInterpAcc->Fill(dThetamin);
fhClustersDZetaInterpAcc->Fill(dZetamin);
nfClu1+=(Int_t)found; // this for debugging purpose
ntClu1++; // to check efficiency of the method FindChip
if(key<1200) {
- if(fMC) { // this part only for MC
+ if(fMC && !lbkg) { // this part only for MC
// Int_t labc1=(Int_t)fClustersLay1[iC1WithBestDist][3];
// Int_t labc2=(Int_t)fClustersLay1[iC1WithBestDist][4];
// Int_t labc3=(Int_t)fClustersLay1[iC1WithBestDist][5];
if (key==fChipPredOnLay1[iC2]) { // this control seems too loose: has to be checked !
// OK, success
- fPlaneEffSPD->UpDatePlaneEff(kTRUE,key); // success
+ pe->UpDatePlaneEff(kTRUE,key); // success
fChipUpdatedInEvent[key]=kTRUE;
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fSuccessP[key]++;
if(secondary) fSuccessS[key]++;
}
} else {
- fPlaneEffSPD->UpDatePlaneEff(kTRUE,key); // this should not be a failure
+ pe->UpDatePlaneEff(kTRUE,key); // this should not be a failure
fChipUpdatedInEvent[key]=kTRUE; // (might be in the tracking tollerance)
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fSuccessP[key]++;
if(secondary) fSuccessS[key]++;
}
} // if no cluster found --> increment statistics by 1 failure (provided you have chip prediction)
else if (fChipPredOnLay1[iC2]<1200) {
- fPlaneEffSPD->UpDatePlaneEff(kFALSE,fChipPredOnLay1[iC2]);
+ pe->UpDatePlaneEff(kFALSE,fChipPredOnLay1[iC2]);
fChipUpdatedInEvent[fChipPredOnLay1[iC2]]=kTRUE;
- if(fMC) {
+ if(fMC && !lbkg) {
if(primary) fFailureP[fChipPredOnLay1[iC2]]++;
if(secondary) fFailureS[fChipPredOnLay1[iC2]]++;
}
Double_t zAbs,phiAbs; // those are the polar coordinate, in the Absolute ALICE Reference
// of the intersection of the tracklet with the pixel layer.
if (TMath::Abs(zVtx)<100) zAbs=zVtx + vtx[2]; // this is fine only for the cluster, not for the track prediction
- else zAbs=r/TMath::Tan(thetaVtx) + vtx[2]; // this is the only way to do for the tracklet prediction
+ else {
+ if(TMath::Abs(thetaVtx)<1E-6) return kFALSE;
+ zAbs=r/TMath::Tan(thetaVtx) + vtx[2]; // this is the only way to do for the tracklet prediction
+ }
AliDebug(1,Form("FindChip: vtx[0] = %f, vtx[1] = %f, vtx[2] = %f",vtx[0],vtx[1],vtx[2]));
Double_t vtxy[2]={vtx[0],vtx[1]};
if (vtxy[0]*vtxy[1]+vtxy[1]*vtxy[1]>0) { // this method holds only for displaced vertices
// AliStack::IsPhysicalPrimary() (note that there also Sigma0 are considered as
// a stable particle: it has no effect on this analysis).
// This method can be called only for MC events, where Kinematics is available.
-// if fUseOnlyStableParticle is kTRUE (via SetseOnlyStableParticle) then it
+// if fUseOnlyStableParticle is kTRUE (via SetUseOnlyStableParticle) then it
// returns kTRUE if also AliITSTrackleterSPDEff::DecayingTrackChecker() return 0.
// The latter (see below) try to verify if a primary particle is also "detectable".
//
}
return;
}
+//_________________________________________________________________
+void AliITSTrackleterSPDEff::DeletePredictionMC() {
+//
+// this method deallocate memory for the MC related informations
+// all the counters are set to 0
+//
+//
+if(fMC) {AliInfo("This method works only if fMC=kTRUE"); return;}
+if(fPredictionPrimary) {
+ delete fPredictionPrimary; fPredictionPrimary=0;
+}
+if(fPredictionSecondary) {
+ delete fPredictionSecondary; fPredictionSecondary=0;
+}
+if(fClusterPrimary) {
+ delete fClusterPrimary; fClusterPrimary=0;
+}
+if(fClusterSecondary) {
+ delete fClusterSecondary; fClusterSecondary=0;
+}
+if(fSuccessPP) {
+ delete fSuccessPP; fSuccessPP=0;
+}
+if(fSuccessTT) {
+ delete fSuccessTT; fSuccessTT=0;
+}
+if(fSuccessS) {
+ delete fSuccessS; fSuccessS=0;
+}
+if(fSuccessP) {
+ delete fSuccessP; fSuccessP=0;
+}
+if(fFailureS) {
+ delete fFailureS; fFailureS=0;
+}
+if(fFailureP) {
+ delete fFailureP; fFailureP=0;
+}
+if(fRecons) {
+ delete fRecons; fRecons=0;
+}
+if(fNonRecons) {
+ delete fNonRecons; fNonRecons=0;
+}
+return;
+}
//______________________________________________________________________
Int_t AliITSTrackleterSPDEff::GetPredictionPrimary(const UInt_t key) const {
//
// none.
// Return:
// none.
- *os << fPhiWindowL1 <<" "<< fZetaWindowL1 << " " << fPhiWindow <<" "<< fZetaWindow
+ *os << fPhiWindowL1 <<" "<< fZetaWindowL1 << " " << fPhiWindowL2 <<" "<< fZetaWindowL2
<< " " << fOnlyOneTrackletPerC1 << " " << fOnlyOneTrackletPerC2
- << " " << fUpdateOncePerEventPlaneEff << " " << fReflectClusterAroundZAxisForLayer0
+ << " " << fUpdateOncePerEventPlaneEff << " " << fMinContVtx
+ << " " << fReflectClusterAroundZAxisForLayer0
<< " " << fReflectClusterAroundZAxisForLayer1;
*os << " " << fMC;
if(!fMC) {AliInfo("Writing only cuts, no MC info"); return;}
// Return:
// none.
- *is >> fPhiWindowL1 >> fZetaWindowL1 >> fPhiWindow >> fZetaWindow
+ Bool_t tmp= fMC;
+ *is >> fPhiWindowL1 >> fZetaWindowL1 >> fPhiWindowL2 >> fZetaWindowL2
>> fOnlyOneTrackletPerC1 >> fOnlyOneTrackletPerC2
- >> fUpdateOncePerEventPlaneEff >> fReflectClusterAroundZAxisForLayer0
+ >> fUpdateOncePerEventPlaneEff >> fMinContVtx
+ >> fReflectClusterAroundZAxisForLayer0
>> fReflectClusterAroundZAxisForLayer1;
+ //if(!fMC) {AliInfo("Reading only cuts, no MC info available");return;}
*is >> fMC;
- if(!fMC) {AliInfo("Reading only cuts, no MC info available");return;}
- *is >> fUseOnlyPrimaryForPred >> fUseOnlySecondaryForPred
- >> fUseOnlySameParticle >> fUseOnlyDifferentParticle
- >> fUseOnlyStableParticle;
- for(Int_t i=0;i<1200;i++) *is >> fPredictionPrimary[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fPredictionSecondary[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fClusterPrimary[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fClusterSecondary[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fSuccessPP[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fSuccessTT[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fSuccessS[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fSuccessP[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fFailureS[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fFailureP[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fRecons[i] ;
- for(Int_t i=0;i<1200;i++) *is >> fNonRecons[i] ;
+ if(!fMC) {AliInfo("Reading only cuts, no MC info"); if(tmp) SetMC(kFALSE); }
+ else {
+ if(!tmp) {AliInfo("Calling SetMC() to read this file wtih MC info"); SetMC();}
+ *is >> fUseOnlyPrimaryForPred >> fUseOnlySecondaryForPred
+ >> fUseOnlySameParticle >> fUseOnlyDifferentParticle
+ >> fUseOnlyStableParticle;
+ for(Int_t i=0;i<1200;i++) *is >> fPredictionPrimary[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fPredictionSecondary[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fClusterPrimary[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fClusterSecondary[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fSuccessPP[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fSuccessTT[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fSuccessS[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fSuccessP[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fFailureS[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fFailureP[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fRecons[i] ;
+ for(Int_t i=0;i<1200;i++) *is >> fNonRecons[i] ;
+ }
return;
}
//______________________________________________________________________
//______________________________________________________________________
void AliITSTrackleterSPDEff::SavePredictionMC(TString filename) const {
//
-// This Method write into an asci file (do not know why binary does not work)
+// This Method write into an either asci or root file
// the used cuts and the statistics of the MC related quantities
// The method SetMC() has to be called before
// Input TString filename: name of file for output (it deletes already existing
// Output: none
//
//
- if(!fMC) {CallWarningMC(); return;}
- ofstream out(filename.Data(),ios::out | ios::binary);
- out << *this;
- out.close();
+ //if(!fMC) {CallWarningMC(); return;}
+ if (!filename.Contains(".root")) {
+ ofstream out(filename.Data(),ios::out | ios::binary);
+ out << *this;
+ out.close();
+ return;
+ }
+ else {
+ TFile* mcfile = TFile::Open(filename, "RECREATE");
+ TH1F* cuts = new TH1F("cuts", "list of cuts", 11, 0, 11); // TH1I containing cuts
+ cuts->SetBinContent(1,fPhiWindowL1);
+ cuts->SetBinContent(2,fZetaWindowL1);
+ cuts->SetBinContent(3,fPhiWindowL2);
+ cuts->SetBinContent(4,fZetaWindowL2);
+ cuts->SetBinContent(5,fOnlyOneTrackletPerC1);
+ cuts->SetBinContent(6,fOnlyOneTrackletPerC2);
+ cuts->SetBinContent(7,fUpdateOncePerEventPlaneEff);
+ cuts->SetBinContent(8,fMinContVtx);
+ cuts->SetBinContent(9,fReflectClusterAroundZAxisForLayer0);
+ cuts->SetBinContent(10,fReflectClusterAroundZAxisForLayer1);
+ cuts->SetBinContent(11,fMC);
+ cuts->Write();
+ delete cuts;
+ if(!fMC) {AliInfo("Writing only cuts, no MC info");}
+ else {
+ TH1C* mc0 = new TH1C("mc0", "mc cuts", 5, 0, 5);
+ mc0->SetBinContent(1,fUseOnlyPrimaryForPred);
+ mc0->SetBinContent(2,fUseOnlySecondaryForPred);
+ mc0->SetBinContent(3,fUseOnlySameParticle);
+ mc0->SetBinContent(4,fUseOnlyDifferentParticle);
+ mc0->SetBinContent(5,fUseOnlyStableParticle);
+ mc0->Write();
+ delete mc0;
+ TH1I *mc1;
+ mc1 = new TH1I("mc1", "mc info PredictionPrimary", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetPredictionPrimary(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc2", "mc info PredictionSecondary", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetPredictionSecondary(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc3", "mc info ClusterPrimary", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetClusterPrimary(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc4", "mc info ClusterSecondary", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetClusterSecondary(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc5", "mc info SuccessPP", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetSuccessPP(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc6", "mc info SuccessTT", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetSuccessTT(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc7", "mc info SuccessS", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetSuccessS(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc8", "mc info SuccessP", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetSuccessP(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc9", "mc info FailureS", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetFailureS(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc10", "mc info FailureP", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetFailureP(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc11", "mc info Recons", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetRecons(i)) ;
+ mc1->Write();
+ mc1 = new TH1I("mc12", "mc info NonRecons", 1200, 0, 1200);
+ for(Int_t i=0;i<1200;i++) mc1->SetBinContent(i+1,GetNonRecons(i)) ;
+ mc1->Write();
+ delete mc1;
+ }
+ mcfile->Close();
+ }
return;
}
//____________________________________________________________________
// Output: none
//
//
- if(!fMC) {CallWarningMC(); return;}
+ //if(!fMC) {CallWarningMC(); return;}
if( gSystem->AccessPathName( filename.Data() ) ) {
AliError( Form( "file (%s) not found", filename.Data() ) );
return;
}
- ifstream in(filename.Data(),ios::in | ios::binary);
- in >> *this;
- in.close();
+ if (!filename.Contains(".root")) {
+ ifstream in(filename.Data(),ios::in | ios::binary);
+ in >> *this;
+ in.close();
+ return;
+ }
+ else {
+ Bool_t tmp= fMC;
+ TFile *mcfile = TFile::Open(filename);
+ TH1F *cuts = (TH1F*)mcfile->Get("cuts");
+ fPhiWindowL1=(Float_t)cuts->GetBinContent(1);
+ fZetaWindowL1=(Float_t)cuts->GetBinContent(2);
+ fPhiWindowL2=(Float_t)cuts->GetBinContent(3);
+ fZetaWindowL2=(Float_t)cuts->GetBinContent(4);
+ fOnlyOneTrackletPerC1=(Bool_t)cuts->GetBinContent(5);
+ fOnlyOneTrackletPerC2=(Bool_t)cuts->GetBinContent(6);
+ fUpdateOncePerEventPlaneEff=(Bool_t)cuts->GetBinContent(7);
+ fMinContVtx=(Int_t)cuts->GetBinContent(8);
+ fReflectClusterAroundZAxisForLayer0=(Bool_t)cuts->GetBinContent(9);
+ fReflectClusterAroundZAxisForLayer1=(Bool_t)cuts->GetBinContent(10);
+ fMC=(Bool_t)cuts->GetBinContent(11);
+ if(!fMC) {AliInfo("Reading only cuts, no MC info"); if(tmp) SetMC(kFALSE); }
+ else { // only if file with MC predictions
+ if(!tmp) {AliInfo("Calling SetMC() to read this file wtih MC info"); SetMC();}
+ TH1C *mc0 = (TH1C*)mcfile->Get("mc0");
+ fUseOnlyPrimaryForPred=(Bool_t)mc0->GetBinContent(1);
+ fUseOnlySecondaryForPred=(Bool_t)mc0->GetBinContent(2);
+ fUseOnlySameParticle=(Bool_t)mc0->GetBinContent(3);
+ fUseOnlyDifferentParticle=(Bool_t)mc0->GetBinContent(4);
+ fUseOnlyStableParticle=(Bool_t)mc0->GetBinContent(5);
+ TH1I *mc1;
+ mc1 =(TH1I*)mcfile->Get("mc1");
+ for(Int_t i=0;i<1200;i++) fPredictionPrimary[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc2");
+ for(Int_t i=0;i<1200;i++) fPredictionSecondary[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc3");
+ for(Int_t i=0;i<1200;i++) fClusterPrimary[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc4");
+ for(Int_t i=0;i<1200;i++) fClusterSecondary[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc5");
+ for(Int_t i=0;i<1200;i++) fSuccessPP[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc6");
+ for(Int_t i=0;i<1200;i++) fSuccessTT[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc7");
+ for(Int_t i=0;i<1200;i++) fSuccessS[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc8");
+ for(Int_t i=0;i<1200;i++) fSuccessP[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc9");
+ for(Int_t i=0;i<1200;i++) fFailureS[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc10");
+ for(Int_t i=0;i<1200;i++) fFailureP[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc11");
+ for(Int_t i=0;i<1200;i++) fRecons[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ mc1 =(TH1I*)mcfile->Get("mc12");
+ for(Int_t i=0;i<1200;i++) fNonRecons[i]=(Int_t)mc1->GetBinContent(i+1) ;
+ }
+ mcfile->Close();
+ }
return;
}
//____________________________________________________________________
if (!GetHistOn()) return kFALSE;
- AliITSMultReconstructor::SaveHists(); // this save the histograms of the base class
+// AliITSMultReconstructor::SaveHists(); // this save the histograms of the base class
+ fhClustersDPhiAll->Write();
+ fhClustersDThetaAll->Write();
+ fhClustersDZetaAll->Write();
+ fhDPhiVsDThetaAll->Write();
+ fhDPhiVsDZetaAll->Write();
+
+ fhClustersDPhiAcc->Write();
+ fhClustersDThetaAcc->Write();
+ fhClustersDZetaAcc->Write();
+ fhDPhiVsDThetaAcc->Write();
+ fhDPhiVsDZetaAcc->Write();
+
+ fhetaTracklets->Write();
+ fhphiTracklets->Write();
+ fhetaClustersLay1->Write();
+ fhphiClustersLay1->Write();
fhClustersDPhiInterpAll->Write();
fhClustersDThetaInterpAll->Write();
fhetaClustersLay2->Write();
fhphiClustersLay2->Write();
+ fhClustersInChip->Write();
+ for (Int_t nhist=0;nhist<80;nhist++){
+ fhClustersInModuleLay1[nhist]->Write();
+ }
+ for (Int_t nhist=0;nhist<160;nhist++){
+ fhClustersInModuleLay2[nhist]->Write();
+ }
return kTRUE;
}
//__________________________________________________________
// Also the histograms from the base class are saved
//
if (!GetHistOn()) return kFALSE;
- if (filename.Data()=="") {
+ if (!strcmp(filename.Data(),"")) {
AliWarning("WriteHistosToFile: null output filename!");
return kFALSE;
}
// layers are computed in the interpolation phase
//
if (! GetHistOn()) { AliInfo("Call SetHistOn(kTRUE) first"); return;}
+//
+ fhClustersDPhiAcc = new TH1F("dphiacc", "dphi", 100,0.,0.1);
+ fhClustersDPhiAcc->SetDirectory(0);
+ fhClustersDThetaAcc = new TH1F("dthetaacc","dtheta",100,-0.1,0.1);
+ fhClustersDThetaAcc->SetDirectory(0);
+ fhClustersDZetaAcc = new TH1F("dzetaacc","dzeta",100,-1.,1.);
+ fhClustersDZetaAcc->SetDirectory(0);
+
+ fhDPhiVsDZetaAcc = new TH2F("dphiVsDzetaacc","",100,-1.,1.,100,0.,0.1);
+ fhDPhiVsDZetaAcc->SetDirectory(0);
+ fhDPhiVsDThetaAcc = new TH2F("dphiVsDthetaAcc","",100,-0.1,0.1,100,0.,0.1);
+ fhDPhiVsDThetaAcc->SetDirectory(0);
+
+ fhClustersDPhiAll = new TH1F("dphiall", "dphi", 100,0.0,0.5);
+ fhClustersDPhiAll->SetDirectory(0);
+ fhClustersDThetaAll = new TH1F("dthetaall","dtheta",100,-0.5,0.5);
+ fhClustersDThetaAll->SetDirectory(0);
+ fhClustersDZetaAll = new TH1F("dzetaall","dzeta",100,-5.,5.);
+ fhClustersDZetaAll->SetDirectory(0);
+
+ fhDPhiVsDZetaAll = new TH2F("dphiVsDzetaall","",100,-5.,5.,100,0.,0.5);
+ fhDPhiVsDZetaAll->SetDirectory(0);
+ fhDPhiVsDThetaAll = new TH2F("dphiVsDthetaAll","",100,-0.5,0.5,100,0.,0.5);
+ fhDPhiVsDThetaAll->SetDirectory(0);
+
+ fhetaTracklets = new TH1F("etaTracklets", "eta", 100,-2.,2.);
+ fhetaTracklets->SetDirectory(0);
+ fhphiTracklets = new TH1F("phiTracklets", "phi", 100, 0., 2*TMath::Pi());
+ fhphiTracklets->SetDirectory(0);
+ fhetaClustersLay1 = new TH1F("etaClustersLay1", "etaCl1", 100,-2.,2.);
+ fhetaClustersLay1->SetDirectory(0);
+ fhphiClustersLay1 = new TH1F("phiClustersLay1", "phiCl1", 100, 0., 2*TMath::Pi());
+ fhphiClustersLay1->SetDirectory(0);
+//
fhClustersDPhiInterpAcc = new TH1F("dphiaccInterp", "dphi Interpolation phase", 100,0.,0.1);
fhClustersDPhiInterpAcc->SetDirectory(0);
fhClustersDThetaInterpAcc = new TH1F("dthetaaccInterp","dtheta Interpolation phase",100,-0.1,0.1);
fhetaClustersLay2->SetDirectory(0);
fhphiClustersLay2 = new TH1F("phiClustersLay2", "phiCl2", 100, 0., 2*TMath::Pi());
fhphiClustersLay2->SetDirectory(0);
+ fhClustersInChip = new TH1F("fhClustersInChip", "ClustersPerChip", 1200, -0.5, 1199.5);
+ fhClustersInChip->SetDirectory(0);
+// each chip is divided 8(z) x 4(y), i.e. in 32 squares, each containing 4 columns and 64 rows.
+ Float_t bz[160]; const Float_t kconv = 1.0E-04; // converts microns to cm.
+ for(Int_t i=0;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
+ bz[ 31] = bz[ 32] = 625.0; // first chip boundry
+ bz[ 63] = bz[ 64] = 625.0; // first chip boundry
+ bz[ 95] = bz[ 96] = 625.0; // first chip boundry
+ bz[127] = bz[128] = 625.0; // first chip boundry
+ Double_t xbins[41]; // each bin in x (Z loc coordinate) includes 4 columns
+ //xbins[0]=0;
+ Float_t xmn,xmx,zmn,zmx;
+ if(!fPlaneEffSPD->GetBlockBoundaries(0,xmn,xmx,zmn,zmx)) AliWarning("Could not book histo properly");
+ xbins[0]=(Double_t)zmn;
+ for(Int_t i=0;i<40;i++) {
+ xbins[i+1]=xbins[i] + (bz[4*i]+bz[4*i+1]+bz[4*i+2]+bz[4*i+3])*kconv;
+ }
+ TString histname="ClustersLay1_mod_",aux;
+ fhClustersInModuleLay1 =new TH2F*[80];
+ for (Int_t nhist=0;nhist<80;nhist++){
+ aux=histname;
+ aux+=nhist;
+ //
+ fhClustersInModuleLay1[nhist]=new TH2F("histname","histname",40,xbins,4,(Double_t)xmn,(Double_t)xmx);
+ fhClustersInModuleLay1[nhist]->SetName(aux.Data());
+ fhClustersInModuleLay1[nhist]->SetTitle(aux.Data());
+ fhClustersInModuleLay1[nhist]->SetDirectory(0);
+ }
+ histname="ClustersLay2_mod_";
+ fhClustersInModuleLay2 =new TH2F*[160];
+ for (Int_t nhist=0;nhist<160;nhist++){
+ aux=histname;
+ aux+=nhist;
+ fhClustersInModuleLay2[nhist]=new TH2F("histname","histname",40,xbins,4,(Double_t)xmn,(Double_t)xmx);
+ fhClustersInModuleLay2[nhist]->SetName(aux.Data());
+ fhClustersInModuleLay2[nhist]->SetTitle(aux.Data());
+ fhClustersInModuleLay2[nhist]->SetDirectory(0);
+ }
+//
return;
}
//____________________________________________________________
//
// Private method to delete Histograms from memory
// it is called. e.g., by the destructor.
+//
+// form AliITSMultReconstructor
+ if(fhClustersDPhiAcc) {delete fhClustersDPhiAcc; fhClustersDPhiAcc=0;}
+ if(fhClustersDThetaAcc) {delete fhClustersDThetaAcc; fhClustersDThetaAcc=0;}
+ if(fhClustersDZetaAcc) {delete fhClustersDZetaAcc; fhClustersDZetaAcc=0;}
+ if(fhClustersDPhiAll) {delete fhClustersDPhiAll; fhClustersDPhiAll=0;}
+ if(fhClustersDThetaAll) {delete fhClustersDThetaAll; fhClustersDThetaAll=0;}
+ if(fhClustersDZetaAll) {delete fhClustersDZetaAll; fhClustersDZetaAll=0;}
+ if(fhDPhiVsDThetaAll) {delete fhDPhiVsDThetaAll; fhDPhiVsDThetaAll=0;}
+ if(fhDPhiVsDThetaAcc) {delete fhDPhiVsDThetaAcc; fhDPhiVsDThetaAcc=0;}
+ if(fhDPhiVsDZetaAll) {delete fhDPhiVsDZetaAll; fhDPhiVsDZetaAll=0;}
+ if(fhDPhiVsDZetaAcc) {delete fhDPhiVsDZetaAcc; fhDPhiVsDZetaAcc=0;}
+ if(fhetaTracklets) {delete fhetaTracklets; fhetaTracklets=0;}
+ if(fhphiTracklets) {delete fhphiTracklets; fhphiTracklets=0;}
+ if(fhetaClustersLay1) {delete fhetaClustersLay1; fhetaClustersLay1=0;}
+ if(fhphiClustersLay1) {delete fhphiClustersLay1; fhphiClustersLay1=0;}
//
if(fhClustersDPhiInterpAcc) {delete fhClustersDPhiInterpAcc; fhClustersDPhiInterpAcc=0;}
if(fhClustersDThetaInterpAcc) {delete fhClustersDThetaInterpAcc; fhClustersDThetaInterpAcc=0;}
if(fhDPhiVsDZetaInterpAcc) {delete fhDPhiVsDZetaInterpAcc; fhDPhiVsDZetaInterpAcc=0;}
if(fhetaClustersLay2) {delete fhetaClustersLay2; fhetaClustersLay2=0;}
if(fhphiClustersLay2) {delete fhphiClustersLay2; fhphiClustersLay2=0;}
+ if(fhClustersInChip) {delete fhClustersInChip; fhClustersInChip=0;}
+ if(fhClustersInModuleLay1) {
+ for (Int_t i=0; i<80; i++ ) delete fhClustersInModuleLay1[i];
+ delete [] fhClustersInModuleLay1; fhClustersInModuleLay1=0;
+ }
+ if(fhClustersInModuleLay2) {
+ for (Int_t i=0; i<160; i++ ) delete fhClustersInModuleLay2[i];
+ delete [] fhClustersInModuleLay2; fhClustersInModuleLay2=0;
+ }
}
//_______________________________________________________________
Bool_t AliITSTrackleterSPDEff::IsReconstructableAt(Int_t layer,Int_t iC,Int_t ipart,
// are available.
// It is used to asses whether a tracklet prediction is reconstructable or not at the other layer
// Input:
-// - Int_t layer (either 0 or 1): layer which you want to chech if the tracklete can be
+// - Int_t layer (either 0 or 1): layer which you want to check if the tracklete can be
// reconstructed at
// - Int_t iC : cluster index used to build the tracklet prediction
// if layer=0 ==> iC=iC2 ; elseif layer=1 ==> iC=iC1
Float_t dZeta = TMath::Cos(fClustersLay1[iC][0])*r2 - trefLayExtr[2];
// make "elliptical" cut in Phi and Zeta!
- Float_t d = TMath::Sqrt(dPhi*dPhi/fPhiWindow/fPhiWindow +
- dZeta*dZeta/fZetaWindow/fZetaWindow);
+ Float_t d = TMath::Sqrt(dPhi*dPhi/fPhiWindowL2/fPhiWindowL2 +
+ dZeta*dZeta/fZetaWindowL2/fZetaWindowL2);
if (d<1) {ret=kTRUE; break;}
}
if(layer==0) { // try to see if it is reconstructable at the inner layer
}
return;
}
+//____________________________________________________________________________
+Int_t AliITSTrackleterSPDEff::Clusters2Tracks(AliESDEvent *esd){
+// This method is used to find the tracklets.
+// It is called from AliReconstruction
+// The vertex is supposed to be associated to the Tracker (i.e. to this) already
+// The cluster is supposed to be associated to the Tracker already
+// In case Monte Carlo is required, the appropriate linking to Stack and TrackRef is attempted
+//
+ Int_t rc=1;
+ // apply cuts on the vertex quality
+ const AliESDVertex *vertex = esd->GetVertex();
+ if(vertex->GetNContributors()<fMinContVtx) return 0;
+ //
+ AliRunLoader* runLoader = AliRunLoader::Instance();
+ if (!runLoader) {
+ Error("Clusters2Tracks", "no run loader found");
+ return rc;
+ }
+ AliStack *pStack=0x0; TTree *tRefTree=0x0;
+ if(GetMC()) {
+ runLoader->LoadKinematics("read");
+ runLoader->LoadTrackRefs("read");
+ pStack= runLoader->Stack();
+ tRefTree= runLoader->TreeTR();
+ }
+ Reconstruct(pStack,tRefTree);
+
+ if (GetLightBkgStudyInParallel()) {
+ AliStack *dummy1=0x0; TTree *dummy2=0x0;
+ ReflectClusterAroundZAxisForLayer(1);
+ Reconstruct(dummy1,dummy2,kTRUE);
+ }
+ return 0;
+}
+//____________________________________________________________________________
+Int_t AliITSTrackleterSPDEff::PostProcess(AliESDEvent *){
+//
+// It is called from AliReconstruction
+//
+//
+//
+//
+ Int_t rc=0;
+ if(GetMC()) SavePredictionMC("TrackletsMCpred.root");
+ if(GetHistOn()) rc=(Int_t)WriteHistosToFile();
+ if(GetLightBkgStudyInParallel()) {
+ TString name="AliITSPlaneEffSPDtrackletBkg.root";
+ TFile* pefile = TFile::Open(name, "RECREATE");
+ rc*=fPlaneEffBkg->Write();
+ pefile->Close();
+ }
+ return rc;
+}
+//____________________________________________________________________
+void
+AliITSTrackleterSPDEff::LoadClusterArrays(TTree* itsClusterTree) {
+ // This method
+ // - gets the clusters from the cluster tree
+ // - convert them into global coordinates
+ // - store them in the internal arrays
+ // - count the number of cluster-fired chips
+
+ //AliDebug(1,"Loading clusters and cluster-fired chips ...");
+
+ fNClustersLay1 = 0;
+ fNClustersLay2 = 0;
+
+ TClonesArray* itsClusters = new TClonesArray("AliITSRecPoint");
+ TBranch* itsClusterBranch=itsClusterTree->GetBranch("ITSRecPoints");
+
+ itsClusterBranch->SetAddress(&itsClusters);
+
+ Int_t nItsSubs = (Int_t)itsClusterTree->GetEntries();
+ Float_t cluGlo[3]={0.,0.,0.};
+
+ // loop over the its subdetectors
+ for (Int_t iIts=0; iIts < nItsSubs; iIts++) {
+
+ if (!itsClusterTree->GetEvent(iIts))
+ continue;
+
+ Int_t nClusters = itsClusters->GetEntriesFast();
+
+ // number of clusters in each chip of the current module
+ Int_t layer = 0;
+
+ // loop over clusters
+ while(nClusters--) {
+ AliITSRecPoint* cluster = (AliITSRecPoint*)itsClusters->UncheckedAt(nClusters);
+
+ layer = cluster->GetLayer();
+ if (layer>1) continue;
+
+ cluster->GetGlobalXYZ(cluGlo);
+ Float_t x = cluGlo[0];
+ Float_t y = cluGlo[1];
+ Float_t z = cluGlo[2];
+
+ if (layer==0) {
+ fClustersLay1[fNClustersLay1][0] = x;
+ fClustersLay1[fNClustersLay1][1] = y;
+ fClustersLay1[fNClustersLay1][2] = z;
+
+ for (Int_t i=0; i<3; i++)
+ fClustersLay1[fNClustersLay1][3+i] = cluster->GetLabel(i);
+ fNClustersLay1++;
+ if(fHistOn) {
+ Int_t det=cluster->GetDetectorIndex();
+ if(det<0 || det>79) {AliError("Cluster with det. index out of boundaries"); return;}
+ fhClustersInModuleLay1[det]->Fill((Double_t)cluster->GetDetLocalZ(),(Double_t)cluster->GetDetLocalX());
+ }
+ }
+ if (layer==1) {
+ fClustersLay2[fNClustersLay2][0] = x;
+ fClustersLay2[fNClustersLay2][1] = y;
+ fClustersLay2[fNClustersLay2][2] = z;
+
+ for (Int_t i=0; i<3; i++)
+ fClustersLay2[fNClustersLay2][3+i] = cluster->GetLabel(i);
+ fNClustersLay2++;
+ if(fHistOn) {
+ Int_t det=cluster->GetDetectorIndex();
+ if(det<0 || det>159) {AliError("Cluster with det. index out of boundaries"); return;}
+ fhClustersInModuleLay2[det]->Fill((Double_t)cluster->GetDetLocalZ(),(Double_t)cluster->GetDetLocalX());
+ }
+ }
+
+ }// end of cluster loop
+
+ } // end of its "subdetector" loop
+ if (itsClusters) {
+ itsClusters->Delete();
+ delete itsClusters;
+ itsClusters = 0;
+ }
+ AliDebug(1,Form("(clusters in layer 1 : %d, layer 2: %d)",fNClustersLay1,fNClustersLay2));
+}
+//_________________________________________________________________________
+void
+AliITSTrackleterSPDEff::SetLightBkgStudyInParallel(Bool_t b) {
+// This method:
+// - set Bool_t fLightBackgroundStudyInParallel = b
+// a) if you set this kTRUE, then the estimation of the
+// SPD efficiency is done as usual for data, but in
+// parallel a light (i.e. without control histograms, etc.)
+// evaluation of combinatorial background is performed
+// with the usual ReflectClusterAroundZAxisForLayer method.
+// b) if you set this kFALSE, then you would not have a second
+// container for PlaneEfficiency statistics to be used for background
+// (fPlaneEffBkg=0). If you want to have a full evaluation of the
+// background (with all control histograms and additional data
+// members referring to the background) then you have to call the
+// method SetReflectClusterAroundZAxisForLayer(kTRUE) esplicitily
+ fLightBkgStudyInParallel=b;
+ if(fLightBkgStudyInParallel) {
+ if(!fPlaneEffBkg) fPlaneEffBkg = new AliITSPlaneEffSPD();
+ }
+ else {
+ delete fPlaneEffBkg;
+ fPlaneEffBkg=0;
+ }
+}
+