X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONQADataMakerSim.cxx;h=0d2f9b32cd53a8300f295579b4b00a3d9ea01e3f;hb=50205ffb02da8c29898866204b3cb3946b89cf22;hp=0ab021bd57a90eb5d4a522279e1ac17b4e0af3f4;hpb=04236e6706a5b16e11ccf14c139bb4a995291429;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONQADataMakerSim.cxx b/MUON/AliMUONQADataMakerSim.cxx index 0ab021bd57a..0d2f9b32cd5 100644 --- a/MUON/AliMUONQADataMakerSim.cxx +++ b/MUON/AliMUONQADataMakerSim.cxx @@ -13,6 +13,17 @@ * 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 @@ -20,13 +31,7 @@ #include #include #include -#include - -// --- AliRoot header files --- -#include "AliLog.h" -#include "AliQAChecker.h" - -#include "AliMUONQADataMakerSim.h" +#include //----------------------------------------------------------------------------- /// \class AliMUONQADataMakerSim @@ -41,16 +46,33 @@ ClassImp(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(qadm.fHitStore->Clone()); + } + if ( qadm.fDigitStore ) + { + fDigitStore = static_cast(qadm.fDigitStore->Clone()); + } SetName((const char*)qadm.GetName()) ; SetTitle((const char*)qadm.GetTitle()); } @@ -58,7 +80,10 @@ AliMUONQADataMakerSim::AliMUONQADataMakerSim(const AliMUONQADataMakerSim& qadm) //__________________________________________________________________ AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMakerSim& qadm ) { - /// Equal operator. + /// Assignment operator + + AliDebug(AliQAv1::GetQADebugLevel(),""); + this->~AliMUONQADataMakerSim(); new(this) AliMUONQADataMakerSim(qadm); return *this; @@ -67,15 +92,130 @@ AliMUONQADataMakerSim& AliMUONQADataMakerSim::operator = (const AliMUONQADataMak //__________________________________________________________________ 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(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(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(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) ; }