* provided "as is" without express or implied warranty. *
**************************************************************************/
+// $Id$
+
+#include "AliMUONQADataMakerSim.h"
+#include "AliMUONHit.h"
+#include "AliMUONDigit.h"
+#include "AliMUONVHitStore.h"
+#include "AliMUONVDigitStore.h"
+
+// --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliQAChecker.h"
// --- ROOT system ---
#include <TClonesArray.h>
#include <TH1F.h>
#include <TH1I.h>
#include <TH2F.h>
-#include <TLorentzVector.h>
-
-// --- AliRoot header files ---
-#include "AliLog.h"
-#include "AliQAChecker.h"
-
-#include "AliMUONQADataMakerSim.h"
+#include <TTree.h>
//-----------------------------------------------------------------------------
/// \class AliMUONQADataMakerSim
//____________________________________________________________________________
AliMUONQADataMakerSim::AliMUONQADataMakerSim() :
- AliQADataMakerSim(AliQA::GetDetName(AliQA::kMUON), "MUON Quality Assurance Data Maker")
+ AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kMUON), "MUON Quality Assurance Data Maker"),
+ fHitStore(0x0),
+ fDigitStore(0x0)
{
- /// ctor
+ /// Default constructor
+
+ AliDebug(AliQAv1::GetQADebugLevel(),"");
}
//____________________________________________________________________________
AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) :
- AliQADataMakerSim()
+ AliQADataMakerSim(),
+ fHitStore(0x0),
+ fDigitStore(0x0)
{
- ///copy ctor
+ /// Copy constructor
+
+ AliDebug(AliQAv1::GetQADebugLevel(),"");
+
+ if ( qadm.fHitStore )
+ {
+ fHitStore = static_cast<AliMUONVHitStore*>(qadm.fHitStore->Clone());
+ }
+ if ( qadm.fDigitStore )
+ {
+ fDigitStore = static_cast<AliMUONVDigitStore*>(qadm.fDigitStore->Clone());
+ }
SetName((const char*)qadm.GetName()) ;
SetTitle((const char*)qadm.GetTitle());
}
//__________________________________________________________________
AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm )
{
- /// Equal operator.
+ /// Assignment operator
+
+ AliDebug(AliQAv1::GetQADebugLevel(),"");
+
this->~AliMUONQADataMakerSim();
new(this) AliMUONQADataMakerSim(qadm);
return *this;
//__________________________________________________________________
AliMUONQADataMakerSim::~AliMUONQADataMakerSim()
{
- /// dtor
+ /// Destructor
+
+ AliDebug(AliQAv1::GetQADebugLevel(),"");
+
+ delete fHitStore;
+ delete fDigitStore;
}
+//__________________________________________________________________
+void AliMUONQADataMakerSim::InitHits()
+{
+ /// Initialized hit spectra
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
+ TH1F* h0 = new TH1F("hHitDetElem", "DetElemId distribution in Hits;Detection element Id;Counts", 1400, 100., 1500.);
+ Add2HitsList(h0, 0, !expert, image);
+
+ TH1F* h1 = new TH1F("hHitPtot", "P distribution in Hits;P [erg];Counts ", 300, 0., 300.);
+ Add2HitsList(h1, 1, !expert, image);
+ return;
+}
+
+//__________________________________________________________________
+void AliMUONQADataMakerSim::InitSDigits()
+{
+ /// Initialized SDigits spectra
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
+ TH1I* h0 = new TH1I("hSDigitsDetElem", "Detection element distribution in SDigits;Detection element Id;Counts", 1400, 100, 1500);
+ Add2SDigitsList(h0, 0, !expert, image);
+
+ TH1F* h1 = new TH1F("hSDigitsCharge", "Charge distribution in SDigits;Charge [??];Counts", 4096, 0, 4095);
+ Add2SDigitsList(h1, 1, !expert, image);
+
+}
+
+//__________________________________________________________________
+void AliMUONQADataMakerSim::InitDigits()
+{
+ /// Initialized Digits spectra
+ const Bool_t expert = kTRUE ;
+ const Bool_t image = kTRUE ;
+
+ TH1I* h0 = new TH1I("hDigitsDetElem", "Detection element distribution in Digits;Detection element Id;Counts", 1400, 100, 1500);
+ Add2DigitsList(h0, 0, !expert, image);
+
+ TH1I* h1 = new TH1I("hDigitsADC", "ADC distribution in Digits;ACD value;Counts", 4096, 0, 4095);
+ Add2DigitsList(h1, 1, !expert, image);
+
+}
+
+//__________________________________________________________________
+void AliMUONQADataMakerSim::MakeHits(TTree* hitsTree)
+{
+ /// makes data from Hits
+
+ if (!fHitStore)
+ fHitStore = AliMUONVHitStore::Create(*hitsTree);
+ fHitStore->Connect(*hitsTree, false);
+ hitsTree->GetEvent(0);
+
+ TIter next(fHitStore->CreateIterator());
+
+ AliMUONHit* hit = 0x0;
+
+ while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
+ {
+ GetHitsData(0)->Fill(hit->DetElemId());
+ GetHitsData(1)->Fill(hit->Momentum());
+ }
+
+
+}
+
+//__________________________________________________________________
+void AliMUONQADataMakerSim::MakeSDigits(TTree* sdigitsTree)
+{
+ /// makes data from SDigits
+
+ if (!fDigitStore)
+ fDigitStore = AliMUONVDigitStore::Create(*sdigitsTree);
+ fDigitStore->Connect(*sdigitsTree, false);
+ sdigitsTree->GetEvent(0);
+
+ TIter next(fDigitStore->CreateIterator());
+
+ AliMUONVDigit* dig = 0x0;
+
+ while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
+ {
+ GetSDigitsData(0)->Fill(dig->DetElemId());
+ GetSDigitsData(1)->Fill(dig->Charge());
+ }
+}
+
+//__________________________________________________________________
+void AliMUONQADataMakerSim::MakeDigits(TTree* digitsTree)
+{
+ /// makes data from Digits
+
+ if (!fDigitStore)
+ fDigitStore = AliMUONVDigitStore::Create(*digitsTree);
+ fDigitStore->Connect(*digitsTree, false);
+ digitsTree->GetEvent(0);
+
+ TIter next(fDigitStore->CreateIterator());
+
+ AliMUONVDigit* dig = 0x0;
+
+ while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) )
+ {
+ GetDigitsData(0)->Fill(dig->DetElemId());
+ GetDigitsData(1)->Fill(dig->ADC());
+ }
+}
+
//____________________________________________________________________________
-void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray* list)
+void AliMUONQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list)
{
///Detector specific actions at end of cycle
// do the QA checking
- AliQAChecker::Instance()->Run(AliQA::kMUON, task, list) ;
+ AliQAChecker::Instance()->Run(AliQAv1::kMUON, task, list) ;
}