]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDQADataMakerSim.cxx
Added analysis of fakes (Francesco)
[u/mrichter/AliRoot.git] / FMD / AliFMDQADataMakerSim.cxx
index 1e8f9b2075e2488d95c0ad287970f5b9fe6e46ec..250e3f18954449141eab266fc12fffdbc14e6992 100644 (file)
@@ -27,6 +27,7 @@
 #include "AliFMDHit.h"
 #include "AliQAChecker.h"
 #include "AliFMDParameters.h"
+#include "AliFMDSDigit.h"
 
 //_____________________________________________________________________
 // This is the class that collects the QA data for the FMD during simulation.
@@ -45,26 +46,39 @@ ClassImp(AliFMDQADataMakerSim)
 #endif
 //_____________________________________________________________________
 AliFMDQADataMakerSim::AliFMDQADataMakerSim() 
-  :  AliQADataMakerSim(AliQA::GetDetName(AliQA::kFMD),
+  :  AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kFMD),
                       "FMD Quality Assurance Data Maker")
 {
   // ctor
-  
+
 }
 
 //_____________________________________________________________________
-AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& qadm
+AliFMDQADataMakerSim::AliFMDQADataMakerSim(const AliFMDQADataMakerSim& /*qadm*/
   : AliQADataMakerSim()
 {
-  //copy ctor 
+  // copy ctor 
+  // 
   // Parameters: 
   //    qadm    Object to copy from
   
+}
+//_____________________________________________________________________
+AliFMDQADataMakerSim& 
+AliFMDQADataMakerSim::operator = (const AliFMDQADataMakerSim& ) 
+{
+  
+  return *this;
+}
+//_____________________________________________________________________
+AliFMDQADataMakerSim::~AliFMDQADataMakerSim()
+{
+
 }
 
 //_____________________________________________________________________
-void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, 
-                                             TObjArray * list)
+void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, 
+                                             TObjArray ** list)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
@@ -72,33 +86,60 @@ void AliFMDQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task,
                  "AliFMDQADataMakerSim","AliFMDQADataMakerSim",
                  "AliFMDQADataMakerSim::EndOfDetectorCycle",
                  "AliFMDQADataMakerSim.cxx",83);
-  AliQAChecker::Instance()->Run(AliQA::kFMD, task, list) ;  
+  AliQAChecker::Instance()->Run(AliQAv1::kFMD, task, list) ;  
   
 }
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::InitSDigits()
+{
+  // create SDigits histograms in SDigits subdir
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1I* hADCCounts = new TH1I("hADCCounts",
+                             "Dist of ADC counts;ADC counts;Entries",
+                             1024,0,1024);
+  hADCCounts->SetXTitle("ADC counts");
+  Add2SDigitsList(hADCCounts, 0, !expert, image);
+}
 
 //____________________________________________________________________ 
 void AliFMDQADataMakerSim::InitHits()
 {
   // create Digits histograms in Digits subdir
-  TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits","Energy distribution",100,0,3);
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1F* hEnergyOfHits = new TH1F("hEnergyOfHits",
+                                "Energy distribution;Energy [MeV];Counts",
+                                100,0,3);
   hEnergyOfHits->SetXTitle("Edep");
   hEnergyOfHits->SetYTitle("Counts");
-  Add2HitsList(hEnergyOfHits, 0);
+  Add2HitsList(hEnergyOfHits, 0, !expert, image);
 }
 
 //_____________________________________________________________________
 void AliFMDQADataMakerSim::InitDigits()
 {
   // create Digits histograms in Digits subdir
-  TH1I* hADCCounts = new TH1I("hADCCounts","Dist of ADC counts",1024,0,1024);
+  const Bool_t expert   = kTRUE ; 
+  const Bool_t image    = kTRUE ; 
+  
+  TH1I* hADCCounts = new TH1I("hADCCounts",
+                             "Dist of ADC counts; ADC counts;Entries",
+                             1024,0,1024);
   hADCCounts->SetXTitle("ADC counts");
-  Add2DigitsList(hADCCounts, 0);
+  Add2DigitsList(hADCCounts, 0, !expert, image);
 }
 
 //_____________________________________________________________________
-void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits)
+void AliFMDQADataMakerSim::MakeHits()
 {
-  TIter next(hits);
+  // Check id histograms already created for this Event Specie
+  if ( ! GetHitsData(0) )
+    InitHits() ;
+
+  TIter next(fHitsArray);
   AliFMDHit * hit;
   while ((hit = static_cast<AliFMDHit *>(next()))) 
     GetHitsData(0)->Fill(hit->Edep()/hit->Length()*0.032);
@@ -108,33 +149,41 @@ void AliFMDQADataMakerSim::MakeHits(TClonesArray * hits)
 void AliFMDQADataMakerSim::MakeHits(TTree * hitTree)
 {
   // make QA data from Hit Tree
+  // 
+  // Parameters: 
+  //   hitTree    Hits container 
+  //
+  if (!fHitsArray) 
+    fHitsArray = new TClonesArray("AliFMDHit", 1000) ; 
+  fHitsArray->Clear() ; 
   
   TBranch * branch = hitTree->GetBranch("FMD") ;
   if (!branch) {
     AliWarning("FMD branch in Hit Tree not found") ; 
     return;
   }
-
-  TClonesArray * tmp =  new TClonesArray("AliFMDHit", 10) ;
-  branch->SetAddress(&tmp) ;
+    
+  branch->SetAddress(&fHitsArray) ;
   
   for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
     branch->GetEntry(ientry);
-    MakeHits(tmp); 
+    MakeHits();   //tmp); 
+    fHitsArray->Clear() ; 
   }    
-  tmp->Delete() ; 
-  delete tmp ; 
 }
 
 //_____________________________________________________________________
-void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits)
+void AliFMDQADataMakerSim::MakeDigits()
 {
   // makes data from Digits
-  if(!digits) return;
-
-  for(Int_t i = 0 ; i < digits->GetEntries() ; i++) {
+  // 
+  // Parameters: 
+  //    none
+  if(!fDigitsArray) return;
+  
+  for(Int_t i = 0 ; i < fDigitsArray->GetEntriesFast() ; i++) {
     //Raw ADC counts
-    AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
+    AliFMDDigit* digit = static_cast<AliFMDDigit*>(fDigitsArray->At(i));
     GetDigitsData(0)->Fill(digit->Counts());
   }
 }
@@ -142,23 +191,73 @@ void AliFMDQADataMakerSim::MakeDigits(TClonesArray * digits)
 //_____________________________________________________________________
 void AliFMDQADataMakerSim::MakeDigits(TTree * digitTree)
 {
+  // Make data from digits. 
+  // 
+  // Parameters: 
+  //    digitTree    Tree holding digits. 
   
-  TClonesArray * digits = new TClonesArray("AliFMDDigit", 1000) ; 
+  if (!fDigitsArray) 
+    fDigitsArray = new TClonesArray("AliFMDDigit", 1000) ; 
+  fDigitsArray->Clear();
   
   TBranch * branch = digitTree->GetBranch("FMD") ;
   if (!branch)    {
       AliWarning("FMD branch in Digit Tree not found") ; 
       return;
   } 
-  branch->SetAddress(&digits) ;
+  branch->SetAddress(&fDigitsArray) ;
+
+  if (fDigitsArray) fDigitsArray->Clear();
+
+  branch->GetEntry(0) ; 
+  MakeDigits() ; 
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeSDigits()
+{
+  // makes data from Digits
+  // 
+  // Parameters: 
+  //   none 
+  if(!fSDigitsArray) return;
+  
+   for(Int_t i = 0 ; i < fSDigitsArray->GetEntriesFast() ; i++) {
+    //Raw ADC counts
+    AliFMDSDigit* sdigit = static_cast<AliFMDSDigit*>(fSDigitsArray->At(i));
+    GetSDigitsData(0)->Fill(sdigit->Counts());
+  }
+}
+
+//_____________________________________________________________________
+void AliFMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
+{
+  // Make data from digits. 
+  // 
+  // Parameters: 
+  //    digitTree    Tree holding digits. 
+  
+  if (!fSDigitsArray) 
+    fSDigitsArray = new TClonesArray("AliFMDSDigit", 1000) ; 
+  fSDigitsArray->Clear() ;
+
+  TBranch * branch = sdigitTree->GetBranch("FMD") ;
+  if (!branch)    {
+    AliWarning("FMD branch in SDigit Tree not found") ; 
+    return;
+  } 
+  branch->SetAddress(&fSDigitsArray) ;
   branch->GetEntry(0) ; 
-  MakeDigits(digits) ; 
+  MakeSDigits() ; 
 }
 
 //_____________________________________________________________________ 
 void AliFMDQADataMakerSim::StartOfDetectorCycle()
 {
-   
+  // Does 
+  // not 
+  // do 
+  // anything 
 }
 //_____________________________________________________________________ 
 //