+Float_t AliITSPlaneEffSPD::GetLocZFromCol(const UInt_t col) const {
+//
+// This method return the local (i.e. detector reference system) lower Z coordinate
+// of the column. To get the central value of a given column, you can do
+// 1/2*[LocZFromCol(col)+LocZFromCol(col+1)].
+//
+// Input: col number in the range [0,kNChip*kNCol]
+// Output: lower local Y coordinate of this row.
+//
+if(col>kNChip*kNCol) // not >= ! allow also computation of upper limit of the last column
+ {AliError("LocZFromCol: you asked for a non existing column"); return 9999999.;}
+// Use only AliITSsegmentationSPD
+AliITSsegmentationSPD spd;
+Double_t dummy,y;
+if(col==kNChip*kNCol) spd.CellBoundries(0,(Int_t)col-1,dummy,dummy,dummy,y);
+else spd.CellBoundries(0,(Int_t)col,dummy,dummy,y,dummy);
+return (Float_t)y;
+
+}
+//__________________________________________________________
+void AliITSPlaneEffSPD::InitHistos() {
+ // for the moment let's create the histograms
+ // module by module
+ TString histnameResX="HistResX_mod_",aux;
+ TString histnameResZ="HistResZ_mod_";
+ TString histnameResXZ="HistResXZ_mod_";
+ TString histnameClusterType="HistClusterType_mod_";
+ TString histnameResXclu="HistResX_mod_";
+ TString histnameResZclu="HistResZ_mod_";
+ TString histnameResXchip="HistResX_mod_";
+ TString histnameResZchip="HistResZ_mod_";
+ TString profnameResXvsPhi="ProfResXvsPhi_mod_";
+ TString profnameResZvsDip="ProfResZvsDip_mod_";
+ TString profnameResXvsPhiclu="ProfResXvsPhi_mod_";
+ TString profnameResZvsDipclu="ProfResZvsDip_mod_";
+ TString histnameTrackErrX="HistTrackErrX_mod_";
+ TString histnameTrackErrZ="HistTrackErrZ_mod_";
+ TString histnameClusErrX="HistClusErrX_mod_";
+ TString histnameClusErrZ="HistClusErrZ_mod_";
+ TString histnameTrackXFOtrue="HistTrackXFOok_mod_";
+ TString histnameTrackZFOtrue="HistTrackZFOok_mod_";
+ TString histnameTrackXFOfalse="HistTrackXFOko_mod_";
+ TString histnameTrackZFOfalse="HistTrackZFOko_mod_";
+ TString histnameTrackXZFOtrue="HistTrackZvsXFOok_mod_";
+ TString histnameTrackXZFOfalse="HistTrackZvsXFOko_mod_";
+//
+
+ TH1::AddDirectory(kFALSE);
+
+ fHisResX=new TH1F*[kNHisto];
+ fHisResZ=new TH1F*[kNHisto];
+ fHisResXZ=new TH2F*[kNHisto];
+ fHisClusterSize=new TH2I*[kNHisto];
+ fHisResXclu=new TH1F**[kNHisto];
+ fHisResZclu=new TH1F**[kNHisto];
+ fHisResXchip=new TH1F**[kNHisto];
+ fHisResZchip=new TH1F**[kNHisto];
+ fProfResXvsPhi=new TProfile*[kNHisto];
+ fProfResZvsDip=new TProfile*[kNHisto];
+ fProfResXvsPhiclu=new TProfile**[kNHisto];
+ fProfResZvsDipclu=new TProfile**[kNHisto];
+ fHisTrackErrX=new TH1F*[kNHisto];
+ fHisTrackErrZ=new TH1F*[kNHisto];
+ fHisClusErrX=new TH1F*[kNHisto];
+ fHisClusErrZ=new TH1F*[kNHisto];
+ fHisTrackXFOtrue=new TH1F**[kNHisto];
+ fHisTrackZFOtrue=new TH1F**[kNHisto];
+ fHisTrackXFOfalse=new TH1F**[kNHisto];
+ fHisTrackZFOfalse=new TH1F**[kNHisto];
+ fHisTrackXZFOtrue=new TH2F**[kNHisto];
+ fHisTrackXZFOfalse=new TH2F**[kNHisto];
+
+ for (Int_t nhist=0;nhist<kNHisto;nhist++){
+ aux=histnameResX;
+ aux+=nhist;
+ fHisResX[nhist]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
+ fHisResX[nhist]->SetName(aux.Data());
+ fHisResX[nhist]->SetTitle(aux.Data());
+
+ aux=histnameResZ;
+ aux+=nhist;
+ fHisResZ[nhist]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
+ fHisResZ[nhist]->SetName(aux.Data());
+ fHisResZ[nhist]->SetTitle(aux.Data());
+
+ aux=histnameResXZ;
+ aux+=nhist;
+ fHisResXZ[nhist]=new TH2F("histname","histname",80,-0.16,0.16,80,-0.32,0.32); // binning:
+ fHisResXZ[nhist]->SetName(aux.Data()); // 40 micron in x;
+ fHisResXZ[nhist]->SetTitle(aux.Data()); // 80 micron in z;
+
+ aux=histnameClusterType;
+ aux+=nhist;
+ fHisClusterSize[nhist]=new TH2I("histname","histname",10,0.5,10.5,10,0.5,10.5);
+ fHisClusterSize[nhist]->SetName(aux.Data());
+ fHisClusterSize[nhist]->SetTitle(aux.Data());
+
+ fHisResXclu[nhist]=new TH1F*[kNclu];
+ fHisResZclu[nhist]=new TH1F*[kNclu];
+ fHisTrackXFOtrue[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackZFOtrue[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackXFOfalse[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackZFOfalse[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackXZFOtrue[nhist]=new TH2F*[kNClockPhase];
+ fHisTrackXZFOfalse[nhist]=new TH2F*[kNClockPhase];
+
+ for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
+ aux=histnameResXclu;
+ aux+=nhist;
+ aux+="_clu_";
+ aux+=clu+1; // clu=0 --> cluster size 1
+ fHisResXclu[nhist][clu]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
+ fHisResXclu[nhist][clu]->SetName(aux.Data());
+ fHisResXclu[nhist][clu]->SetTitle(aux.Data());
+
+ aux=histnameResZclu;
+ aux+=nhist;
+ aux+="_clu_";
+ aux+=clu+1; // clu=0 --> cluster size 1
+ fHisResZclu[nhist][clu]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
+ fHisResZclu[nhist][clu]->SetName(aux.Data());
+ fHisResZclu[nhist][clu]->SetTitle(aux.Data());
+ }
+
+ fHisResXchip[nhist]=new TH1F*[kNChip];
+ fHisResZchip[nhist]=new TH1F*[kNChip];
+ for(Int_t chip=0; chip<kNChip; chip++) {
+ aux=histnameResXchip;
+ aux+=nhist;
+ aux+="_chip_";
+ aux+=chip;
+ fHisResXchip[nhist][chip]=new TH1F("histname","histname",800,-0.32,0.32); // +- 3200 micron; 1 bin=8 micron
+ fHisResXchip[nhist][chip]->SetName(aux.Data());
+ fHisResXchip[nhist][chip]->SetTitle(aux.Data());
+
+ aux=histnameResZchip;
+ aux+=nhist;
+ aux+="_chip_";
+ aux+=chip;
+ fHisResZchip[nhist][chip]=new TH1F("histname","histname",300,-0.48,0.48); // +-4800 micron; 1 bin=32 micron
+ fHisResZchip[nhist][chip]->SetName(aux.Data());
+ fHisResZchip[nhist][chip]->SetTitle(aux.Data());
+ }
+
+ aux=histnameTrackErrX;
+ aux+=nhist;
+ fHisTrackErrX[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
+ fHisTrackErrX[nhist]->SetName(aux.Data());
+ fHisTrackErrX[nhist]->SetTitle(aux.Data());
+
+ aux=histnameTrackErrZ;
+ aux+=nhist;
+ fHisTrackErrZ[nhist]=new TH1F("histname","histname",200,0.,0.32); // 0-3200 micron; 1 bin=16 micron
+ fHisTrackErrZ[nhist]->SetName(aux.Data());
+ fHisTrackErrZ[nhist]->SetTitle(aux.Data());
+
+ aux=histnameClusErrX;
+ aux+=nhist;
+ fHisClusErrX[nhist]=new TH1F("histname","histname",400,0.,0.08); // 0-800 micron; 1 bin=2 micron
+ fHisClusErrX[nhist]->SetName(aux.Data());
+ fHisClusErrX[nhist]->SetTitle(aux.Data());
+
+ aux=histnameClusErrZ;
+ aux+=nhist;
+ fHisClusErrZ[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
+ fHisClusErrZ[nhist]->SetName(aux.Data());
+ fHisClusErrZ[nhist]->SetTitle(aux.Data());
+
+ aux=profnameResXvsPhi;
+ aux+=nhist;
+ fProfResXvsPhi[nhist]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40°
+ fProfResXvsPhi[nhist]->SetName(aux.Data()); // bin width: 2°
+ fProfResXvsPhi[nhist]->SetTitle(aux.Data());
+
+ aux=profnameResZvsDip;
+ aux+=nhist;
+ fProfResZvsDip[nhist]=new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-4°
+ fProfResZvsDip[nhist]->SetName(aux.Data()); // bin width: 3°
+ fProfResZvsDip[nhist]->SetTitle(aux.Data());
+
+ fProfResXvsPhiclu[nhist]=new TProfile*[kNclu];
+ fProfResZvsDipclu[nhist]=new TProfile*[kNclu];
+ for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
+ aux=profnameResXvsPhiclu;
+ aux+=nhist;
+ aux+="_clu_";
+ aux+=clu+1; // clu=0 --> cluster size 1
+ fProfResXvsPhiclu[nhist][clu]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40
+ fProfResXvsPhiclu[nhist][clu]->SetName(aux.Data()); // bin width: 2°
+ fProfResXvsPhiclu[nhist][clu]->SetTitle(aux.Data());
+
+ aux=profnameResZvsDipclu;
+ aux+=nhist;
+ aux+="_clu_";
+ aux+=clu+1; // clu=0 --> cluster size 1
+ fProfResZvsDipclu[nhist][clu]= new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-7°
+ fProfResZvsDipclu[nhist][clu]->SetName(aux.Data()); // bin width: 3°
+ fProfResZvsDipclu[nhist][clu]->SetTitle(aux.Data());
+ }
+
+ fHisTrackXFOtrue[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackZFOtrue[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackXFOfalse[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackZFOfalse[nhist]=new TH1F*[kNClockPhase];
+ fHisTrackXZFOtrue[nhist]=new TH2F*[kNClockPhase];
+ fHisTrackXZFOfalse[nhist]=new TH2F*[kNClockPhase];
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+ aux=histnameTrackXFOtrue;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackXFOtrue[nhist][phas]=new TH1F("histname","histname",128,-0.64,0.64); // +- 6.4 mm; 1 bin=0.1 mm
+ fHisTrackXFOtrue[nhist][phas]->SetName(aux.Data());
+ fHisTrackXFOtrue[nhist][phas]->SetTitle(aux.Data());
+
+ aux=histnameTrackZFOtrue;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackZFOtrue[nhist][phas]=new TH1F("histname","histname",350,-3.5,3.5); // +- 35. mm; 1 bin=0.2 mm
+ fHisTrackZFOtrue[nhist][phas]->SetName(aux.Data());
+ fHisTrackZFOtrue[nhist][phas]->SetTitle(aux.Data());
+
+ aux=histnameTrackXFOfalse;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackXFOfalse[nhist][phas]=new TH1F("histname","histname",128,-0.64,0.64); // +- 6.4 mm; 1 bin=0.1 mm
+ fHisTrackXFOfalse[nhist][phas]->SetName(aux.Data());
+ fHisTrackXFOfalse[nhist][phas]->SetTitle(aux.Data());
+
+ aux=histnameTrackZFOfalse;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackZFOfalse[nhist][phas]=new TH1F("histname","histname",350,-3.5,3.5); // +- 35. mm; 1 bin=0.2 mm
+ fHisTrackZFOfalse[nhist][phas]->SetName(aux.Data());
+ fHisTrackZFOfalse[nhist][phas]->SetTitle(aux.Data());
+
+ aux=histnameTrackXZFOtrue;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackXZFOtrue[nhist][phas]=new TH2F("histname","histname",22,-3.5,3.5,32,-0.64,0.64); // localZ +- 35. mm; 1 bin=3.2 mm
+ fHisTrackXZFOtrue[nhist][phas]->SetName(aux.Data()); // localX +- 6.4 mm; 1 bin=0.4 mm
+ fHisTrackXZFOtrue[nhist][phas]->SetTitle(aux.Data());
+
+ aux=histnameTrackXZFOfalse;
+ aux+=nhist;
+ aux+="_BCmod4_";
+ aux+=phas;
+ fHisTrackXZFOfalse[nhist][phas]=new TH2F("histname","histname",22,-3.5,3.5,32,-0.64,0.64); // localZ +- 35. mm; 1 bin=3.2 mm
+ fHisTrackXZFOfalse[nhist][phas]->SetName(aux.Data()); // localX +- 6.4 mm; 1 bin=0.4 mm
+ fHisTrackXZFOfalse[nhist][phas]->SetTitle(aux.Data());
+ }
+ } // end loop on module
+
+ TH1::AddDirectory(kTRUE);
+
+return;
+}
+//__________________________________________________________
+void AliITSPlaneEffSPD::DeleteHistos() {
+ if(fHisResX) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisResX[i];
+ delete [] fHisResX; fHisResX=0;
+ }
+ if(fHisResZ) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisResZ[i];
+ delete [] fHisResZ; fHisResZ=0;
+ }
+ if(fHisResXZ) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisResXZ[i];
+ delete [] fHisResXZ; fHisResXZ=0;
+ }
+ if(fHisClusterSize) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusterSize[i];
+ delete [] fHisClusterSize; fHisClusterSize=0;
+ }
+ if(fHisResXclu) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t clu=0; clu<kNclu; clu++) if (fHisResXclu[i][clu]) delete fHisResXclu[i][clu];
+ delete [] fHisResXclu[i];
+ }
+ delete [] fHisResXclu;
+ fHisResXclu = 0;
+ }
+ if(fHisResZclu) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t clu=0; clu<kNclu; clu++) if (fHisResZclu[i][clu]) delete fHisResZclu[i][clu];
+ delete [] fHisResZclu[i];
+ }
+ delete [] fHisResZclu;
+ fHisResZclu = 0;
+ }
+ if(fHisResXchip) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t chip=0; chip<kNChip; chip++) if (fHisResXchip[i][chip]) delete fHisResXchip[i][chip];
+ delete [] fHisResXchip[i];
+ }
+ delete [] fHisResXchip;
+ fHisResXchip = 0;
+ }
+ if(fHisResZchip) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t chip=0; chip<kNChip; chip++) if (fHisResZchip[i][chip]) delete fHisResZchip[i][chip];
+ delete [] fHisResZchip[i];
+ }
+ delete [] fHisResZchip;
+ fHisResZchip = 0;
+ }
+ if(fHisTrackErrX) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrX[i];
+ delete [] fHisTrackErrX; fHisTrackErrX=0;
+ }
+ if(fHisTrackErrZ) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrZ[i];
+ delete [] fHisTrackErrZ; fHisTrackErrZ=0;
+ }
+ if(fHisClusErrX) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrX[i];
+ delete [] fHisClusErrX; fHisClusErrX=0;
+ }
+ if(fHisClusErrZ) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrZ[i];
+ delete [] fHisClusErrZ; fHisClusErrZ=0;
+ }
+ if(fProfResXvsPhi) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fProfResXvsPhi[i];
+ delete [] fProfResXvsPhi; fProfResXvsPhi=0;
+ }
+ if(fProfResZvsDip) {
+ for (Int_t i=0; i<kNHisto; i++ ) delete fProfResZvsDip[i];
+ delete [] fProfResZvsDip; fProfResZvsDip=0;
+ }
+ if(fProfResXvsPhiclu) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t clu=0; clu<kNclu; clu++) if (fProfResXvsPhiclu[i][clu]) delete fProfResXvsPhiclu[i][clu];
+ delete [] fProfResXvsPhiclu[i];
+ }
+ delete [] fProfResXvsPhiclu;
+ fProfResXvsPhiclu = 0;
+ }
+ if(fProfResZvsDipclu) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t clu=0; clu<kNclu; clu++) if (fProfResZvsDipclu[i][clu]) delete fProfResZvsDipclu[i][clu];
+ delete [] fProfResZvsDipclu[i];
+ }
+ delete [] fProfResZvsDipclu;
+ fProfResZvsDipclu = 0;
+ }
+ if(fHisTrackXFOtrue) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackXFOtrue[i][phas]) delete fHisTrackXFOtrue[i][phas];
+ delete [] fHisTrackXFOtrue[i];
+ }
+ delete [] fHisTrackXFOtrue;
+ fHisTrackXFOtrue = 0;
+ }
+ if(fHisTrackZFOtrue) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackZFOtrue[i][phas]) delete fHisTrackZFOtrue[i][phas];
+ delete [] fHisTrackZFOtrue[i];
+ }
+ delete [] fHisTrackZFOtrue;
+ fHisTrackZFOtrue = 0;
+ }
+ if(fHisTrackXFOfalse) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackXFOfalse[i][phas]) delete fHisTrackXFOfalse[i][phas];
+ delete [] fHisTrackXFOfalse[i];
+ }
+ delete [] fHisTrackXFOfalse;
+ fHisTrackXFOfalse = 0;
+ }
+ if(fHisTrackZFOfalse) {
+ for (Int_t i=0; i<kNHisto; i++ ) {
+ for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackZFOfalse[i][phas]) delete fHisTrackZFOfalse[i][phas];
+ delete [] fHisTrackZFOfalse[i];
+ }
+ delete [] fHisTrackZFOfalse;
+ fHisTrackZFOfalse = 0;
+ }
+return;
+}
+//__________________________________________________________
+Bool_t AliITSPlaneEffSPD::FillHistos(UInt_t key, Bool_t found,
+ Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
+//
+// depending on the value of key this method
+// either call the standard one for clusters
+// or the one for FO studies
+// if key < 1200 --> call FillHistosST
+// if key >= 1200 --> call FillHistosFO
+if(key>=kNModule*kNChip*(kNClockPhase+1))
+ {AliError("GetChipFromKey: you asked for a non existing key"); return kFALSE;}
+if(key<kNModule*kNChip) return FillHistosStd(key,found,tr,clu,csize,angtrkmod);
+else return FillHistosFO(key,found,tr);
+return kFALSE;
+}
+//__________________________________________________________
+Bool_t AliITSPlaneEffSPD::FillHistosFO(UInt_t key, Bool_t found, Float_t *tr) {
+// this method fill the histograms for FastOr studies
+// input: - key: unique key of the basic block
+// - found: Boolean to asses whether a FastOr bit has been associated to the track or not
+// - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
+// - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
+// output: kTRUE if filling was succesfull kFALSE otherwise
+// side effects: updating of the histograms.
+ if (!fHis) {
+ AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
+ return kFALSE;
+ }
+ if(key>=kNModule*kNChip*(kNClockPhase+1))
+ {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
+ if(key<kNModule*kNChip)
+ {AliWarning("FillHistos: you asked for a key which is not for FO studies"); return kFALSE;}
+ Int_t id=GetModFromKey(key);
+ Int_t BCm4=GetBCm4FromKey(key);
+ if(id>=kNHisto)
+ {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
+ if(found) {
+ fHisTrackXFOtrue[id][BCm4]->Fill(tr[0]);
+ fHisTrackZFOtrue[id][BCm4]->Fill(tr[1]);
+ fHisTrackXZFOtrue[id][BCm4]->Fill(tr[1],tr[0]);
+ }
+ else {
+ fHisTrackXFOfalse[id][BCm4]->Fill(tr[0]);
+ fHisTrackZFOfalse[id][BCm4]->Fill(tr[1]);
+ fHisTrackXZFOfalse[id][BCm4]->Fill(tr[1],tr[0]);
+ }
+return kTRUE;
+}
+//__________________________________________________________
+Bool_t AliITSPlaneEffSPD::FillHistosStd(UInt_t key, Bool_t found,
+ Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
+// this method fill the histograms
+// input: - key: unique key of the basic block
+// - found: Boolean to asses whether a cluster has been associated to the track or not
+// - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
+// - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
+// - clu[0],clu[1] local X and Z coordinates of the cluster associated to the track, respectively
+// - clu[2],clu[3] error on local X and Z coordinates of the cluster associated to the track, respectively
+// - csize[0][1] cluster size in X and Z, respectively
+// - angtrkmod[0],angtrkmod[1]
+// output: kTRUE if filling was succesfull kFALSE otherwise
+// side effects: updating of the histograms.
+//
+ if (!fHis) {
+ AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
+ return kFALSE;
+ }
+ if(key>=kNModule*kNChip)
+ {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
+ Int_t id=GetModFromKey(key);
+ Int_t chip=GetChipFromKey(key);
+ if(id>=kNHisto)
+ {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
+ if(found) {
+ Float_t resx=tr[0]-clu[0];
+ Float_t resz=tr[1]-clu[1];
+ fHisResX[id]->Fill(resx);
+ fHisResZ[id]->Fill(resz);
+ fHisResXZ[id]->Fill(resx,resz);
+ fHisClusterSize[id]->Fill((Double_t)csize[0],(Double_t)csize[1]);
+ if(csize[0]>0 && csize[0]<=kNclu) fHisResXclu[id][csize[0]-1]->Fill(resx);
+ if(csize[1]>0 && csize[1]<=kNclu) fHisResZclu[id][csize[1]-1]->Fill(resz);
+ fHisResXchip[id][chip]->Fill(resx);
+ fHisResZchip[id][chip]->Fill(resz);
+ fProfResXvsPhi[id]->Fill(angtrkmod[0],resx);
+ fProfResZvsDip[id]->Fill(angtrkmod[1],resz);
+ if(csize[0]>0 && csize[0]<=kNclu) fProfResXvsPhiclu[id][csize[0]-1]->Fill(angtrkmod[0],resx);
+ if(csize[1]>0 && csize[1]<=kNclu) fProfResZvsDipclu[id][csize[1]-1]->Fill(angtrkmod[1],resz);
+ }
+ fHisTrackErrX[id]->Fill(tr[2]);
+ fHisTrackErrZ[id]->Fill(tr[3]);
+ fHisClusErrX[id]->Fill(clu[2]);
+ fHisClusErrZ[id]->Fill(clu[3]);
+ return kTRUE;
+}
+//__________________________________________________________
+Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) {
+ //
+ // Saves the histograms into a tree and saves the trees into a file
+ //
+ if (!fHis) return kFALSE;
+ if (filename.IsNull() || filename.IsWhitespace()) {
+ AliWarning("WriteHistosToFile: null output filename!");
+ return kFALSE;
+ }
+ char branchname[51];
+ TFile *hFile=new TFile(filename.Data(),option,
+ "The File containing the TREEs with ITS PlaneEff Histos");
+ TTree *SPDTree=new TTree("SPDTree","Tree whith Residuals and Cluster Type distributions for SPD");
+ TH1F *histZ,*histX;
+ TH2F *histXZ;
+ TH2I *histClusterType;
+ TH1F *histXclu[kNclu];
+ TH1F *histZclu[kNclu];
+ TH1F *histXchip[kNChip];
+ TH1F *histZchip[kNChip];
+ TH1F *histTrErrZ,*histTrErrX;
+ TH1F *histClErrZ,*histClErrX;
+ TProfile *profXvsPhi,*profZvsDip;
+ TProfile *profXvsPhiclu[kNclu],*profZvsDipclu[kNclu];
+ TH1F *histXtrkFOtrue[kNClockPhase];
+ TH1F *histZtrkFOtrue[kNClockPhase];
+ TH1F *histXtrkFOfalse[kNClockPhase];
+ TH1F *histZtrkFOfalse[kNClockPhase];
+ TH2F *histXZtrkFOtrue[kNClockPhase];
+ TH2F *histXZtrkFOfalse[kNClockPhase];
+
+ histZ=new TH1F();
+ histX=new TH1F();
+ histXZ=new TH2F();
+ histClusterType=new TH2I();
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ histXclu[clu]=new TH1F();
+ histZclu[clu]=new TH1F();
+ }
+ for(Int_t chip=0;chip<kNChip;chip++) {
+ histXchip[chip]=new TH1F();
+ histZchip[chip]=new TH1F();
+ }
+
+ histTrErrX=new TH1F();
+ histTrErrZ=new TH1F();
+ histClErrX=new TH1F();
+ histClErrZ=new TH1F();
+ profXvsPhi=new TProfile();
+ profZvsDip=new TProfile();
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ profXvsPhiclu[clu]=new TProfile();
+ profZvsDipclu[clu]=new TProfile();
+ }
+
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+ histXtrkFOtrue[phas]=new TH1F();
+ histZtrkFOtrue[phas]=new TH1F();
+ histXtrkFOfalse[phas]=new TH1F();
+ histZtrkFOfalse[phas]=new TH1F();
+ histXZtrkFOtrue[phas]=new TH2F();
+ histXZtrkFOfalse[phas]=new TH2F();
+ }
+
+ SPDTree->Branch("histX","TH1F",&histX,128000,0);
+ SPDTree->Branch("histZ","TH1F",&histZ,128000,0);
+ SPDTree->Branch("histXZ","TH2F",&histXZ,128000,0);
+ SPDTree->Branch("histClusterType","TH2I",&histClusterType,128000,0);
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ snprintf(branchname,50,"histXclu_%d",clu+1);
+ SPDTree->Branch(branchname,"TH1F",&histXclu[clu],128000,0);
+ snprintf(branchname,50,"histZclu_%d",clu+1);
+ SPDTree->Branch(branchname,"TH1F",&histZclu[clu],128000,0);
+ }
+ for(Int_t chip=0;chip<kNChip;chip++) {
+ snprintf(branchname,50,"histXchip_%d",chip);
+ SPDTree->Branch(branchname,"TH1F",&histXchip[chip],128000,0);
+ snprintf(branchname,50,"histZchip_%d",chip);
+ SPDTree->Branch(branchname,"TH1F",&histZchip[chip],128000,0);
+ }
+ SPDTree->Branch("histTrErrX","TH1F",&histTrErrX,128000,0);
+ SPDTree->Branch("histTrErrZ","TH1F",&histTrErrZ,128000,0);
+ SPDTree->Branch("histClErrX","TH1F",&histClErrX,128000,0);
+ SPDTree->Branch("histClErrZ","TH1F",&histClErrZ,128000,0);
+ SPDTree->Branch("profXvsPhi","TProfile",&profXvsPhi,128000,0);
+ SPDTree->Branch("profZvsDip","TProfile",&profZvsDip,128000,0);
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
+ SPDTree->Branch(branchname,"TProfile",&profXvsPhiclu[clu],128000,0);
+ snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
+ SPDTree->Branch(branchname,"TProfile",&profZvsDipclu[clu],128000,0);
+ }
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+ snprintf(branchname,50,"histTrXFOokBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH1F",&histXtrkFOtrue[phas],128000,0);
+ snprintf(branchname,50,"histTrZFOokBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH1F",&histZtrkFOtrue[phas],128000,0);
+ snprintf(branchname,50,"histTrXFOkoBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH1F",&histXtrkFOfalse[phas],128000,0);
+ snprintf(branchname,50,"histTrZFOkoBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH1F",&histZtrkFOfalse[phas],128000,0);
+ snprintf(branchname,50,"histTrXZFOokBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH2F",&histXZtrkFOtrue[phas],128000,0);
+ snprintf(branchname,50,"histTrXZFOkoBCmod4_%d",phas);
+ SPDTree->Branch(branchname,"TH2F",&histXZtrkFOfalse[phas],128000,0);
+ }
+
+ for(Int_t j=0;j<kNHisto;j++){
+ histX=fHisResX[j];
+ histZ=fHisResZ[j];
+ histXZ=fHisResXZ[j];
+ histClusterType=fHisClusterSize[j];
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ histXclu[clu]=fHisResXclu[j][clu];
+ histZclu[clu]=fHisResZclu[j][clu];
+ }
+ for(Int_t chip=0;chip<kNChip;chip++) {
+ histXchip[chip]=fHisResXchip[j][chip];
+ histZchip[chip]=fHisResZchip[j][chip];
+ }
+ histTrErrX=fHisTrackErrX[j];
+ histTrErrZ=fHisTrackErrZ[j];
+ histClErrX=fHisClusErrX[j];
+ histClErrZ=fHisClusErrZ[j];
+ profXvsPhi=fProfResXvsPhi[j];
+ profZvsDip=fProfResZvsDip[j];
+ for(Int_t clu=0;clu<kNclu;clu++) {
+ profXvsPhiclu[clu]=fProfResXvsPhiclu[j][clu];
+ profZvsDipclu[clu]=fProfResZvsDipclu[j][clu];
+ }
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+ histXtrkFOtrue[phas]=fHisTrackXFOtrue[j][phas];
+ histZtrkFOtrue[phas]=fHisTrackZFOtrue[j][phas];
+ histXtrkFOfalse[phas]=fHisTrackXFOfalse[j][phas];
+ histZtrkFOfalse[phas]=fHisTrackZFOfalse[j][phas];
+ histXZtrkFOtrue[phas]=fHisTrackXZFOtrue[j][phas];
+ histXZtrkFOfalse[phas]=fHisTrackXZFOfalse[j][phas];
+ }
+
+ SPDTree->Fill();
+ }
+ hFile->Write();
+ hFile->Close();
+return kTRUE;
+}
+//__________________________________________________________
+Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) {
+ //
+ // Read histograms from an already existing file
+ //
+ if (!fHis) return kFALSE;
+ if (filename.IsNull() || filename.IsWhitespace()) {
+ AliWarning("ReadHistosFromFile: incorrect output filename!");
+ return kFALSE;
+ }
+ char branchname[51];
+
+ TH1F *h = 0;
+ TH2F *h2 = 0;
+ TH2I *h2i= 0;
+ TProfile *p = 0;
+
+ TFile *file=TFile::Open(filename.Data(),"READONLY");
+
+ if (!file || file->IsZombie()) {
+ AliWarning(Form("Can't open %s !",filename.Data()));
+ delete file;
+ return kFALSE;
+ }
+ TTree *tree = (TTree*) file->Get("SPDTree");
+
+ TBranch *histX = (TBranch*) tree->GetBranch("histX");
+ TBranch *histZ = (TBranch*) tree->GetBranch("histZ");
+ TBranch *histXZ = (TBranch*) tree->GetBranch("histXZ");
+ TBranch *histClusterType = (TBranch*) tree->GetBranch("histClusterType");
+
+ TBranch *histXclu[kNclu], *histZclu[kNclu];
+ for(Int_t clu=0; clu<kNclu; clu++) {
+ snprintf(branchname,50,"histXclu_%d",clu+1);
+ histXclu[clu]= (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histZclu_%d",clu+1);
+ histZclu[clu]= (TBranch*) tree->GetBranch(branchname);
+ }
+
+ TBranch *histXchip[kNChip], *histZchip[kNChip];
+ for(Int_t chip=0; chip<kNChip; chip++) {
+ snprintf(branchname,50,"histXchip_%d",chip);
+ histXchip[chip]= (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histZchip_%d",chip);
+ histZchip[chip]= (TBranch*) tree->GetBranch(branchname);
+ }
+
+ TBranch *histTrErrX = (TBranch*) tree->GetBranch("histTrErrX");
+ TBranch *histTrErrZ = (TBranch*) tree->GetBranch("histTrErrZ");
+ TBranch *histClErrX = (TBranch*) tree->GetBranch("histClErrX");
+ TBranch *histClErrZ = (TBranch*) tree->GetBranch("histClErrZ");
+ TBranch *profXvsPhi = (TBranch*) tree->GetBranch("profXvsPhi");
+ TBranch *profZvsDip = (TBranch*) tree->GetBranch("profZvsDip");
+
+ TBranch *profXvsPhiclu[kNclu], *profZvsDipclu[kNclu];
+ for(Int_t clu=0; clu<kNclu; clu++) {
+ snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
+ profXvsPhiclu[clu]= (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
+ profZvsDipclu[clu]= (TBranch*) tree->GetBranch(branchname);
+ }
+
+ TBranch *histXtrkFOtrue[kNClockPhase], *histZtrkFOtrue[kNClockPhase],
+ *histXtrkFOfalse[kNClockPhase], *histZtrkFOfalse[kNClockPhase],
+ *histXZtrkFOtrue[kNClockPhase], *histXZtrkFOfalse[kNClockPhase];
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+ snprintf(branchname,50,"histTrXFOokBCmod4_%d",phas);
+ histXtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histTrZFOokBCmod4_%d",phas);
+ histZtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histTrXFOkoBCmod4_%d",phas);
+ histXtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histTrZFOkoBCmod4_%d",phas);
+ histZtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histTrXZFOokBCmod4_%d",phas);
+ histXZtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
+ snprintf(branchname,50,"histTrXZFOkoBCmod4_%d",phas);
+ histXZtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
+ }
+
+ gROOT->cd();
+
+ Int_t nevent = (Int_t)histX->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histX->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histX->GetEntry(j);
+ fHisResX[j]->Add(h);
+ }
+
+ nevent = (Int_t)histZ->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histZ->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histZ->GetEntry(j);
+ fHisResZ[j]->Add(h);
+ }
+
+ nevent = (Int_t)histXZ->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXZ->SetAddress(&h2);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXZ->GetEntry(j);
+ fHisResXZ[j]->Add(h2);
+ }
+
+ nevent = (Int_t)histClusterType->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histClusterType->SetAddress(&h2i);
+ for(Int_t j=0;j<kNHisto;j++){
+ histClusterType->GetEntry(j);
+ fHisClusterSize[j]->Add(h2i);
+ }
+
+ for(Int_t clu=0; clu<kNclu; clu++) {
+
+ nevent = (Int_t)histXclu[clu]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXclu[clu]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXclu[clu]->GetEntry(j);
+ fHisResXclu[j][clu]->Add(h);
+ }
+
+ nevent = (Int_t)histZclu[clu]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histZclu[clu]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histZclu[clu]->GetEntry(j);
+ fHisResZclu[j][clu]->Add(h);
+ }
+ }
+
+
+ for(Int_t chip=0; chip<kNChip; chip++) {
+
+ nevent = (Int_t)histXchip[chip]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXchip[chip]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXchip[chip]->GetEntry(j);
+ fHisResXchip[j][chip]->Add(h);
+ }
+
+ nevent = (Int_t)histZchip[chip]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histZchip[chip]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histZchip[chip]->GetEntry(j);
+ fHisResZchip[j][chip]->Add(h);
+ }
+ }
+
+ nevent = (Int_t)histTrErrX->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histTrErrX->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histTrErrX->GetEntry(j);
+ fHisTrackErrX[j]->Add(h);
+ }
+
+ nevent = (Int_t)histTrErrZ->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histTrErrZ->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histTrErrZ->GetEntry(j);
+ fHisTrackErrZ[j]->Add(h);
+ }
+
+ nevent = (Int_t)histClErrX->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histClErrX->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histClErrX->GetEntry(j);
+ fHisClusErrX[j]->Add(h);
+ }
+
+ nevent = (Int_t)histClErrZ->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histClErrZ->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histClErrZ->GetEntry(j);
+ fHisClusErrZ[j]->Add(h);
+ }
+ nevent = (Int_t)profXvsPhi->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ profXvsPhi->SetAddress(&p);
+ for(Int_t j=0;j<kNHisto;j++){
+ profXvsPhi->GetEntry(j);
+ fProfResXvsPhi[j]->Add(p);
+ }
+
+ nevent = (Int_t)profZvsDip->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ profZvsDip->SetAddress(&p);
+ for(Int_t j=0;j<kNHisto;j++){
+ profZvsDip->GetEntry(j);
+ fProfResZvsDip[j]->Add(p);
+ }
+
+ for(Int_t clu=0; clu<kNclu; clu++) {
+
+ nevent = (Int_t)profXvsPhiclu[clu]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ profXvsPhiclu[clu]->SetAddress(&p);
+ for(Int_t j=0;j<kNHisto;j++){
+ profXvsPhiclu[clu]->GetEntry(j);
+ fProfResXvsPhiclu[j][clu]->Add(p);
+ }
+
+ nevent = (Int_t)profZvsDipclu[clu]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ profZvsDipclu[clu]->SetAddress(&p);
+ for(Int_t j=0;j<kNHisto;j++){
+ profZvsDipclu[clu]->GetEntry(j);
+ fProfResZvsDipclu[j][clu]->Add(p);
+ }
+ }
+
+ for(Int_t phas=0; phas<kNClockPhase;phas++){
+
+ nevent = (Int_t)histXtrkFOtrue[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXtrkFOtrue[phas]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXtrkFOtrue[phas]->GetEntry(j);
+ fHisTrackXFOtrue[j][phas]->Add(h);
+ }
+
+ nevent = (Int_t)histZtrkFOtrue[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histZtrkFOtrue[phas]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histZtrkFOtrue[phas]->GetEntry(j);
+ fHisTrackZFOtrue[j][phas]->Add(h);
+ }
+
+ nevent = (Int_t)histXtrkFOfalse[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXtrkFOfalse[phas]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXtrkFOfalse[phas]->GetEntry(j);
+ fHisTrackXFOfalse[j][phas]->Add(h);
+ }
+
+ nevent = (Int_t)histZtrkFOfalse[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histZtrkFOfalse[phas]->SetAddress(&h);
+ for(Int_t j=0;j<kNHisto;j++){
+ histZtrkFOfalse[phas]->GetEntry(j);
+ fHisTrackZFOfalse[j][phas]->Add(h);
+ }
+
+ nevent = (Int_t)histXZtrkFOtrue[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXZtrkFOtrue[phas]->SetAddress(&h2);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXZtrkFOtrue[phas]->GetEntry(j);
+ fHisTrackXZFOtrue[j][phas]->Add(h2);
+ }
+
+ nevent = (Int_t)histXZtrkFOfalse[phas]->GetEntries();
+ if(nevent!=kNHisto)
+ {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
+ histXZtrkFOfalse[phas]->SetAddress(&h2);
+ for(Int_t j=0;j<kNHisto;j++){
+ histXZtrkFOfalse[phas]->GetEntry(j);
+ fHisTrackXZFOfalse[j][phas]->Add(h2);
+ }
+
+ }
+
+ delete h;
+ delete h2;
+ delete h2i;
+ delete p;
+
+ if (file) {
+ file->Close();
+ delete file;
+ }
+return kTRUE;
+}
+