]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSPlaneEffSSD.cxx
Bug fix
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEffSSD.cxx
index 08d58e4c56b8fa5d4965992e09bd4a7ce7b83c43..378455f593b3952379746e39d69cacbfac4a8177 100644 (file)
@@ -50,10 +50,10 @@ AliITSPlaneEffSSD::AliITSPlaneEffSSD():
   fHisClusErrX(0),
   fHisClusErrZ(0){
   for (UInt_t i=0; i<kNModule; i++){
+  // default constructor
     fFound[i]=0;
     fTried[i]=0;
   }
-  // default constructor
   AliDebug(1,Form("Calling default constructor"));
 }
 //______________________________________________________________________
@@ -99,7 +99,7 @@ fHisClusErrZ(0)
       s.fHisClusterSize[i]->Copy(*fHisClusterSize[i]);
       s.fHisTrackErrX[i]->Copy(*fHisTrackErrX[i]);
       s.fHisTrackErrZ[i]->Copy(*fHisTrackErrZ[i]);
-      s.fHisClusErrX[i]->Copy(*fHisTrackErrZ[i]);
+      s.fHisClusErrX[i]->Copy(*fHisClusErrX[i]);
       s.fHisClusErrZ[i]->Copy(*fHisClusErrZ[i]);
    }
  }
@@ -125,7 +125,7 @@ AliITSPlaneEffSSD& AliITSPlaneEffSSD::operator+=(const AliITSPlaneEffSSD &add){
         fHisClusterSize[i]->Add(add.fHisClusterSize[i]);
         fHisTrackErrX[i]->Add(add.fHisTrackErrX[i]);
         fHisTrackErrZ[i]->Add(add.fHisTrackErrZ[i]);
-        fHisClusErrX[i]->Add(add.fHisTrackErrZ[i]);
+        fHisClusErrX[i]->Add(add.fHisClusErrX[i]);
         fHisClusErrZ[i]->Add(add.fHisClusErrZ[i]);
       }
     }
@@ -143,6 +143,8 @@ AliITSPlaneEffSSD&  AliITSPlaneEffSSD::operator=(const
     // Return:
  
     if(this==&s) return *this;
+    this->~AliITSPlaneEffSSD();
+    new(this) AliITSPlaneEffSSD();
     s.Copy(*this);
     return *this;
 }
@@ -184,23 +186,7 @@ void AliITSPlaneEffSSD::CopyHistos(AliITSPlaneEffSSD &target) const {
   }
 return;
 }
-/* Commented out by M.Masera 8/3/08
-//______________________________________________________________________
-AliITSPlaneEff&  AliITSPlaneEffSSD::operator=(const
-                                           AliITSPlaneEff &s){
-    //    Assignment operator
-    // Inputs:
-    //    AliITSPlaneEffSSD &s The original class for which
-    //                                this class is a copy of
-    // Outputs:
-    //    none.
-    // Return:
 
-    if(&s == this) return *this;
-    AliError("operator=: Not allowed to make a =, use default creater instead");
-    return *this;
-}
-*/
 //_______________________________________________________________________
 Int_t AliITSPlaneEffSSD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr,
           UInt_t im) const {
@@ -382,6 +368,7 @@ return kTRUE;
 }
 //_____________________________________________________________________________
 Bool_t AliITSPlaneEffSSD::AddFromCDB(AliCDBId *cdbId) {
+// Read (actually add the statistics) plane eff. from Data Base
 AliCDBEntry *cdbEntry=0;
 if (!cdbId) {
   if(!fInitCDBCalled)
@@ -443,21 +430,21 @@ void AliITSPlaneEffSSD::InitHistos() {
   for (Int_t nhist=0;nhist<kNHisto;nhist++){
     aux=histnameResX;
     aux+=nhist;
-    fHisResX[nhist]=new TH1F("histname","histname",500,-0.05,0.05); // +- 500 micron; 1 bin=2 micron
+    fHisResX[nhist]=new TH1F("histname","histname",500,-0.10,0.10); // +- 1000 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",500,-0.50,0.50); // +-5000 micron; 1 bin=20 micron
+    fHisResZ[nhist]=new TH1F("histname","histname",750,-0.75,0.75); // +-5000 micron; 1 bin=20 micron
     fHisResZ[nhist]->SetName(aux.Data());
     fHisResZ[nhist]->SetTitle(aux.Data());
 
     aux=histnameResXZ;
     aux+=nhist;
-    fHisResXZ[nhist]=new TH2F("histname","histname",40,-0.02,0.02,40,-0.16,0.16); // binning:
-                                                                                   // 10 micron in x;
-                                                                                   // 80 micron in z;
+    fHisResXZ[nhist]=new TH2F("histname","histname",40,-0.04,0.04,40,-0.32,0.32); // binning:
+                                                                                   // 20 micron in x;
+                                                                                   // 160 micron in z;
     fHisResXZ[nhist]->SetName(aux.Data());
     fHisResXZ[nhist]->SetTitle(aux.Data());
 
@@ -469,25 +456,25 @@ void AliITSPlaneEffSSD::InitHistos() {
 
     aux=histnameTrackErrX;
     aux+=nhist;
-    fHisTrackErrX[nhist]=new TH1F("histname","histname",200,0.,0.08); // 0-800 micron; 1 bin=4 micron
+    fHisTrackErrX[nhist]=new TH1F("histname","histname",300,0.,0.24); // 0-2400 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]=new TH1F("histname","histname",300,0.,0.48); // 0-4800 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",200,0.,0.08); //  0-800 micron; 1 bin=4 micron
+    fHisClusErrX[nhist]=new TH1F("histname","histname",300,0.,0.24); //  0-2400 micron; 1 bin=8 micron
     fHisClusErrX[nhist]->SetName(aux.Data());
     fHisClusErrX[nhist]->SetTitle(aux.Data());
 
     aux=histnameClusErrZ;
     aux+=nhist;
-    fHisClusErrZ[nhist]=new TH1F("histname","histname",200,0.,0.16); //  0-1600 micron; 1 bin=8 micron
+    fHisClusErrZ[nhist]=new TH1F("histname","histname",200,0.,0.32); //  0-1600 micron; 1 bin=16 micron
     fHisClusErrZ[nhist]->SetName(aux.Data());
     fHisClusErrZ[nhist]->SetTitle(aux.Data());
 
@@ -499,6 +486,7 @@ return;
 }
 //__________________________________________________________
 void AliITSPlaneEffSSD::DeleteHistos() {
+// Delete histograms and remove them from memory 
   if(fHisResX) {
     for (Int_t i=0; i<kNHisto; i++ ) delete fHisResX[i];
     delete [] fHisResX; fHisResX=0;
@@ -536,8 +524,7 @@ return;
 }
 //__________________________________________________________
 Bool_t AliITSPlaneEffSSD::FillHistos(UInt_t key, Bool_t found,
-                                 //    Float_t tXZ[2], Float_t cXZ[2], Int_t ctXZ[2]) {
-                                     Float_t *tr, Float_t *clu, Int_t *csize) {
+                                     Float_t *tr, Float_t *clu, Int_t *csize, Float_t*) {
 // 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
@@ -582,7 +569,7 @@ Bool_t AliITSPlaneEffSSD::WriteHistosToFile(TString filename, Option_t* option)
      AliWarning("WriteHistosToFile: null output filename!");
      return kFALSE;
   }
-//  char branchname[30];
+
   TFile *hFile=new TFile(filename.Data(),option,
                          "The File containing the TREEs with ITS PlaneEff Histos");
   TTree *SSDTree=new TTree("SSDTree","Tree whith Residuals and Cluster Type distributions for SSD");
@@ -636,7 +623,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
      AliWarning("ReadHistosFromFile: incorrect output filename!");
      return kFALSE;
   }
-  //char branchname[30];
 
   TH1F *h  = 0;
   TH2F *h2 = 0;
@@ -667,7 +653,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histX->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
     histX->GetEntry(j);
     fHisResX[j]->Add(h);
   }
@@ -677,7 +662,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histZ->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
     histZ->GetEntry(j);
     fHisResZ[j]->Add(h);
   }
@@ -687,7 +671,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histXZ->SetAddress(&h2);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h2; h2=0;
     histXZ->GetEntry(j);
     fHisResXZ[j]->Add(h2);
   }
@@ -697,7 +680,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histClusterType->SetAddress(&h2i);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h2i; h2i=0;
     histClusterType->GetEntry(j);
     fHisClusterSize[j]->Add(h2i);
   }
@@ -707,7 +689,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histTrErrX->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
     histTrErrX->GetEntry(j);
     fHisTrackErrX[j]->Add(h);
   }
@@ -717,7 +698,6 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histTrErrZ->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
     histTrErrZ->GetEntry(j);
     fHisTrackErrZ[j]->Add(h);
   }
@@ -727,7 +707,7 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histClErrX->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
+    //delete h; h=0;
     histClErrX->GetEntry(j);
     fHisClusErrX[j]->Add(h);
   }
@@ -737,17 +717,19 @@ Bool_t AliITSPlaneEffSSD::ReadHistosFromFile(TString filename) {
     {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
   histClErrZ->SetAddress(&h);
   for(Int_t j=0;j<kNHisto;j++){
-    delete h; h=0;
+    //delete h; h=0; 
     histClErrZ->GetEntry(j);
     fHisClusErrZ[j]->Add(h);
   }
 
-  delete h;   h=0;
-  delete h2;  h2=0;
-  delete h2i; h2i=0;
+  delete h;   
+  delete h2;  
+  delete h2i; 
 
   if (file) {
     file->Close();
+    delete file;
   }
 return kTRUE;
 }
+