All data must be mergeable objects.
P. Christiansen, Lund, January 2008
+ Updated July 2011:
+ ==================
+
+ Major changes to accomodate updates of general DQM/QA changes to have per
+ trigger histograms (for a given event specie).
+
+ 1) One instance of AliTPCdataQA only. (This also solves some old wishes by
+ offline team to use less memory because event the 2d arrays for this object
+ is not used). This now has a new flag for only keeping DQM info event by
+ event! For this reason there is no need for a special DQM reset any more
+ between runs!
+
+ 2) Fill the histogram for each event. The histograms are no longer filled
+ from the AliTPCdataQA but per event.
+
+ 3) Use profiles for the RAW info. By adding the profiles event by event we
+ get the correct event averages WITHOUT having to normalize in the end!
+ Results should therefore also be directly mergable when that feature will
+ come. (none of the other histograms are merged).
+
+ This means that from the DQM/QA point of view the TPC DQM is now fully
+ standard and should ease future developments.
+
Updated June 2010:
==================
AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTPC),
"TPC Rec Quality Assurance Data Maker"),
fTPCdataQA(NULL),
-fRawMaxEvents(100000),
-fRawEventsPerBin(1000),
fRawFirstTimeBin(1),
fRawLastTimeBin(1000)
{
// ctor
- fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
- fTPCdataQA[specie] = NULL ;
for(Int_t i = 0; i < 6; i++)
fMapping[i] = 0;
AliTPCQADataMakerRec::AliTPCQADataMakerRec(const AliTPCQADataMakerRec& qadm) :
AliQADataMakerRec(),
fTPCdataQA(NULL),
- fRawMaxEvents(qadm.GetRawMaxEvents()),
- fRawEventsPerBin(qadm.GetRawEventsPerBin()),
fRawFirstTimeBin(qadm.GetRawFirstTimeBin()),
fRawLastTimeBin(qadm.GetRawLastTimeBin())
{
SetName((const char*)qadm.GetName()) ;
SetTitle((const char*)qadm.GetTitle());
- fTPCdataQA = new AliTPCdataQA*[AliRecoParam::kNSpecies] ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
- fTPCdataQA[specie] = NULL ;
-
for(Int_t i = 0; i < 6; i++)
fMapping[i] = 0;
-
- //
- // Associate class histogram objects to the copies in the list
- // Could also be done with the indexes
- //
-
}
//__________________________________________________________________
AliTPCQADataMakerRec::~AliTPCQADataMakerRec()
{
// Destructor
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++)
- if ( fTPCdataQA[specie] != NULL )
- delete fTPCdataQA[specie] ;
- delete[] fTPCdataQA;
+ delete fTPCdataQA;
for(Int_t i = 0; i < 6; i++)
delete fMapping[i];
{
//Detector specific actions at end of cycle
ResetEventTrigClasses();
- //
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
- if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
- if (fTPCdataQA[specie] == NULL) continue; // do the final step of the QA for Raw data
- fTPCdataQA[specie]->Analyse(); // 31/1-08 Analyse is now protected against
- // RAW data files with no TPC data
-
- SetEventSpecie(AliRecoParam::ConvertIndex(specie));
- //
- for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over all trigger class clones
-
- TH1F * histRawsOccupancy = (TH1F*)GetRawsData(kRawsOccupancy, itc);
- TH1F * histRawsOccupancyVsSector = (TH1F*)GetRawsData(kRawsOccupancyVsSector, itc);
- TH1F * histRawsNClustersPerEventVsSector = (TH1F*)GetRawsData(kRawsNClustersPerEventVsSector, itc);
- TH1F * histRawsQVsSector = (TH1F*)GetRawsData(kRawsQVsSector, itc);
- TH1F * histRawsQmaxVsSector = (TH1F*)GetRawsData(kRawsQmaxVsSector, itc) ;
- TH1F * histRawsOccupancyVsEvent = (TH1F*)GetRawsData(kRawsOccupancyVsEvent, itc);
- TH1F * histRawsNclustersVsEvent = (TH1F*)GetRawsData(kRawsNclustersVsEvent, itc);
- if ( !histRawsOccupancy ||
- !histRawsOccupancyVsSector ||
- !histRawsNClustersPerEventVsSector ||
- !histRawsQVsSector ||
- !histRawsQmaxVsSector ||
- !histRawsOccupancyVsEvent ||
- !histRawsNclustersVsEvent ) {
- AliError("Something very wrong here, corrupted memory ?????. Please check\n") ;
- continue ;
- }
-
- //Add2RawsList(fTPCdataQA, 0);
- // get the histograms and add them to the output
- // 31/8-08 Histogram is only added if the Calibration class
- // receives TPC data
- const Int_t eventCounter = fTPCdataQA[specie]->GetEventCounter(); // RS : to change
- if(eventCounter>0) { // some TPC data has been processed
-
- // Reset histograms and refill them
- histRawsOccupancy->Reset();
- histRawsOccupancyVsSector->Reset();
- histRawsNClustersPerEventVsSector->Reset();
- histRawsQVsSector->Reset();
- histRawsQmaxVsSector->Reset();
-
- TH1F* hNormOcc = new TH1F("hNormOcc", 0, 72, 0, 72);
- hNormOcc->Sumw2();
- TH1F* hNormNclusters = new TH1F("hNormNclusters", 0, 72, 0, 72);
- hNormNclusters->Sumw2();
-
- for (Int_t iSec = 0; iSec < 72; iSec++) {
-
- AliTPCCalROC* occupancyROC =
- fTPCdataQA[specie]->GetNoThreshold()->GetCalROC(iSec);
- AliTPCCalROC* nclusterROC =
- fTPCdataQA[specie]->GetNLocalMaxima()->GetCalROC(iSec);
- AliTPCCalROC* qROC =
- fTPCdataQA[specie]->GetMeanCharge()->GetCalROC(iSec);
- AliTPCCalROC* qmaxROC =
- fTPCdataQA[specie]->GetMaxCharge()->GetCalROC(iSec);
-
- const Int_t nRows = occupancyROC->GetNrows();
- for (Int_t iRow = 0; iRow < nRows; iRow++) {
-
- const Int_t nPads = occupancyROC->GetNPads(iRow);
- for (Int_t iPad = 0; iPad < nPads; iPad++) {
-
- histRawsOccupancy->Fill(occupancyROC->GetValue(iRow, iPad));
- hNormOcc->Fill(iSec);
- histRawsOccupancyVsSector->Fill(iSec, occupancyROC->GetValue(iRow, iPad));
-
- const Int_t nClusters = TMath::Nint(nclusterROC->GetValue(iRow, iPad));
-
- if(nClusters>0) {
-
- hNormNclusters->Fill(iSec,nClusters);
- histRawsNClustersPerEventVsSector->Fill(iSec, nClusters);
- histRawsQVsSector->Fill(iSec,
- nClusters*qROC->GetValue(iRow, iPad));
- histRawsQmaxVsSector->Fill(iSec,
- nClusters*qmaxROC->GetValue(iRow, iPad));
- }
- }
- }
- } // end loop over sectors
-
- // update event histograms - copy info from TPDdataQA histos
- const TH1F* hQAOccVsEvent = fTPCdataQA[specie]->GetHistOccupancyVsEvent();
- const TH1F* hQANclVsEvent = fTPCdataQA[specie]->GetHistNclustersVsEvent();
-
- // In case the histogram limits have changed we have to update
- // them here
- if(histRawsOccupancy->GetXaxis()->GetXmax()!=
- hQAOccVsEvent->GetXaxis()->GetXmax()) {
-
- histRawsOccupancyVsEvent->GetXaxis()->Set(histRawsOccupancyVsEvent->GetXaxis()->GetNbins(), hQAOccVsEvent->GetXaxis()->GetXmin(), hQAOccVsEvent->GetXaxis()->GetXmax());
-
- histRawsNclustersVsEvent->GetXaxis()->Set(histRawsOccupancyVsEvent->GetXaxis()->GetNbins(), hQANclVsEvent->GetXaxis()->GetXmin(), hQANclVsEvent->GetXaxis()->GetXmax());
- }
-
- // reset the number of entries
- histRawsOccupancyVsEvent->SetEntries(0);
- histRawsNclustersVsEvent->SetEntries(0);
-
- // the two event histograms should have the same number of bins
- const Int_t nBins = hQAOccVsEvent->GetXaxis()->GetNbins();
- for(Int_t bin = 1; bin <= nBins; bin++) {
-
- histRawsOccupancyVsEvent->SetBinContent(bin, hQAOccVsEvent->GetBinContent(bin));
- histRawsNclustersVsEvent->SetBinContent(bin, hQANclVsEvent->GetBinContent(bin));
- }
-
- // Normalize histograms
- histRawsOccupancyVsSector->Divide(hNormOcc);
- histRawsNClustersPerEventVsSector->Scale(1.0/Float_t(eventCounter));
- histRawsQVsSector->Divide(hNormNclusters);
- histRawsQmaxVsSector->Divide(hNormNclusters);
- delete hNormOcc;
- delete hNormNclusters;
-
- } //
- } // RS: loop over all trigger class clones
- } // loop over species
- //
AliQAChecker::Instance()->Run(AliQAv1::kTPC, task, list) ;
}
new TH1F("hESDclusters", "N TPC clusters per track; N clusters; Counts",
160, 0, 160);
histESDclusters->Sumw2();
- Add2ESDsList(histESDclusters, KClusters, !expert, image);
+ Add2ESDsList(histESDclusters, kClusters, !expert, image);
TH1F * histESDratio =
new TH1F("hESDratio", "Ratio: TPC clusters / findable; Ratio: cluster/findable; Counts",
const Bool_t saveCorr = kTRUE ;
const Bool_t image = kTRUE ;
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-
- // It might happen that we will be in this method a few times because
- // we create all dataQAs at the first call to this method
- if(fTPCdataQA[specie]!=0) // data QA already created
- continue;
-
- fTPCdataQA[specie] =
- new AliTPCdataQA(AliRecoParam::ConvertIndex(specie));
- LoadMaps(); // Load Altro maps
- fTPCdataQA[specie]->SetAltroMapping(fMapping); // set Altro mapping
- fTPCdataQA[specie]->SetRangeTime(fRawFirstTimeBin, fRawLastTimeBin); // set time bin interval
- fTPCdataQA[specie]->SetMaxEvents(fRawMaxEvents);
- fTPCdataQA[specie]->SetEventsPerBin(fRawEventsPerBin);
-// Add2RawsList(fTPCdataQA, kTPCdataQ, !expert, image, !saveCorrA); // This is used by the AMORE monitoring <------- THIS WILL FAIL (YS)
- }
-
- TH1F * histRawsOccupancy =
- new TH1F("hRawsOccupancy", "Occupancy (all pads); Occupancy; Counts",
- 100, 0, 1);
- histRawsOccupancy->Sumw2();
- Add2RawsList(histRawsOccupancy, kRawsOccupancy, expert, !image, !saveCorr);
+ fTPCdataQA = new AliTPCdataQA();
+ LoadMaps(); // Load Altro maps
+ fTPCdataQA->SetAltroMapping(fMapping); // set Altro mapping
+ fTPCdataQA->SetRangeTime(fRawFirstTimeBin, fRawLastTimeBin); // set time bin interval
+ fTPCdataQA->SetIsDQM(kTRUE);
- TH1F * histRawsOccupancyVsSector =
- new TH1F("hRawsOccupancyVsSector", "Occupancy vs sector; Sector; Occupancy",
+ TProfile * histRawsOccupancyVsSector =
+ new TProfile("hRawsOccupancyVsSector", "Occupancy vs sector; Sector; Occupancy",
72, 0, 72);
- histRawsOccupancyVsSector->Sumw2();
histRawsOccupancyVsSector->SetMarkerStyle(20);
histRawsOccupancyVsSector->SetOption("P");
histRawsOccupancyVsSector->SetStats(kFALSE);
Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr);
-
- TH1F * histRawsNClustersPerEventVsSector =
- new TH1F("hRawsNClustersPerEventVsSector", "Nclusters per event vs sector; Sector; Nclusters per event",
- 72, 0, 72);
- histRawsNClustersPerEventVsSector->Sumw2();
- Add2RawsList(histRawsNClustersPerEventVsSector, kRawsNClustersPerEventVsSector, expert, !image, !saveCorr);
- TH1F * histRawsQVsSector =
- new TH1F("hRawsQVsSector", "<Q> vs sector; Sector; <Q>",
+ TProfile * histRawsQVsSector =
+ new TProfile("hRawsQVsSector", "<Q> vs sector; Sector; <Q>",
72, 0, 72);
- histRawsQVsSector->Sumw2();
Add2RawsList(histRawsQVsSector, kRawsQVsSector, expert, !image, !saveCorr);
- TH1F * histRawsQmaxVsSector =
- new TH1F("hRawsQmaxVsSector", "<Qmax> vs sector; Sector; <Qmax>",
+ TProfile * histRawsQmaxVsSector =
+ new TProfile("hRawsQmaxVsSector", "<Qmax> vs sector; Sector; <Qmax>",
72, 0, 72);
- histRawsQmaxVsSector->Sumw2();
histRawsQmaxVsSector->SetMarkerStyle(20);
histRawsQmaxVsSector->SetOption("P");
histRawsQmaxVsSector->SetStats(kFALSE);
Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr);
-
- // Get histogram information from data QA to build copy
- const TH1F* hOccHelp = fTPCdataQA[0]->GetHistOccupancyVsEvent();
- TH1F * histRawsOccupancyVsEvent =
- CreateEventsHistCopy(hOccHelp, "hRawsOccupancyVsEvent");
- Add2RawsList(histRawsOccupancyVsEvent, kRawsOccupancyVsEvent, expert, !image, !saveCorr);
-
- // Get histogram information from data QA to build copy
- const TH1F* hNclHelp = fTPCdataQA[0]->GetHistNclustersVsEvent();
- TH1F * histRawsNclustersVsEvent =
- CreateEventsHistCopy(hNclHelp, "hRawsNclustersVsEvent");
- Add2RawsList(histRawsNclustersVsEvent, kRawsNclustersVsEvent, expert, !image, !saveCorr);
//
ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
}
Int_t nTPCclusters = track->GetTPCNcls();
Int_t nTPCclustersFindable = track->GetTPCNclsF();
if ( nTPCclustersFindable<=0) continue;
- FillESDsData(KClusters,nTPCclusters);
+ FillESDsData(kClusters,nTPCclusters);
FillESDsData(kRatio,Float_t(nTPCclusters)/Float_t(nTPCclustersFindable));
FillESDsData(kPt,track->Pt());
}
GetRawsData(0); // dummy call to init raw data
rawReader->Reset() ;
- if (! fTPCdataQA[AliRecoParam::AConvert(fEventSpecie)] ) {
- AliError("Something unexpected here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") ;
- return;
+ if (! fTPCdataQA ) {
+
+ AliError("No TPC data QA (no call to InitRaws?)!!!!") ;
+ } else {
+
+ if(fTPCdataQA->GetIsDQM() == kFALSE)
+ AliError("Data QA has to be initialized as DQM!!!!") ;
+
+ // Fill profile data
+ fTPCdataQA->ResetProfiles();
+
+ if(fTPCdataQA->ProcessEvent(rawReader)) { // means that TPC data was processed
+
+ fTPCdataQA->FillOccupancyProfile();
+
+ // Fill histograms
+ TObjArray *arrRW = GetMatchingRawsData(kRawsOccupancyVsSector); // all kRawsOccupancyVsSector clones matching to triggers
+ for (int ih=arrRW->GetEntriesFast();ih--;) {
+ TProfile* hRawsOccupancyVsSector = dynamic_cast<TProfile*>(arrRW->At(ih));
+ if (hRawsOccupancyVsSector) hRawsOccupancyVsSector->Add(fTPCdataQA->GetHistOccVsSector());
+ }
+ arrRW = GetMatchingRawsData(kRawsQVsSector);
+ for (int ih=arrRW->GetEntriesFast();ih--;) {
+ TProfile* hRawsQVsSector = dynamic_cast<TProfile*>(arrRW->At(ih));
+ if (hRawsQVsSector) hRawsQVsSector->Add(fTPCdataQA->GetHistQVsSector());
+ }
+ arrRW = GetMatchingRawsData(kRawsQmaxVsSector);
+ for (int ih=arrRW->GetEntriesFast();ih--;) {
+ TProfile* hRawsQmaxVsSector = dynamic_cast<TProfile*>(arrRW->At(ih));
+ if (hRawsQmaxVsSector) hRawsQmaxVsSector->Add(fTPCdataQA->GetHistQmaxVsSector());
+ }
+ //
+ IncEvCountCycleRaws();
+ IncEvCountTotalRaws();
+ //
+ }
}
-
- fTPCdataQA[AliRecoParam::AConvert(fEventSpecie)]->ProcessEvent(rawReader);
- //
- IncEvCountCycleRaws();
- IncEvCountTotalRaws();
- //
}
//____________________________________________________________________________
}
}
-//____________________________________________________________________________
-void AliTPCQADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
-{
- // Overwrites general method for RAW data.
- // The AliTPCdataQA elements that does the internal processing are
- // in the case they have processed data deleted and new are created
-
- // Reset histograms for all tasks
- AliQADataMakerRec::ResetDetector(task);
-
- for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
-
- if ( fTPCdataQA[specie] != NULL) { // exist
-
- if(fTPCdataQA[specie]->GetEventCounter()>0) { // has processed data
-
- // old configuration
- Int_t firstTime = fTPCdataQA[specie]->GetFirstTimeBin();
- Int_t lastTime = fTPCdataQA[specie]->GetLastTimeBin();
- Int_t minADC = fTPCdataQA[specie]->GetAdcMin();
- Int_t maxADC = fTPCdataQA[specie]->GetAdcMax();
-
- //delete old
- delete fTPCdataQA[specie];
-
- // create new
- fTPCdataQA[specie] = new AliTPCdataQA(AliRecoParam::ConvertIndex(specie));
- // configure new
- LoadMaps(); // Load Altro maps
- fTPCdataQA[specie]->SetAltroMapping(fMapping);
- fTPCdataQA[specie]->SetRangeTime(firstTime, lastTime);
- fTPCdataQA[specie]->SetRangeAdc(minADC, maxADC);
- // Here we want to restore the default configuration because
- // the max events and events are adjusted for the last run
- fTPCdataQA[specie]->SetMaxEvents(fRawMaxEvents);
- fTPCdataQA[specie]->SetEventsPerBin(fRawEventsPerBin);
- }
- }
- }
-}
-
-//____________________________________________________________________________
-TH1F* AliTPCQADataMakerRec::CreateEventsHistCopy(const TH1F* hist,
- const Char_t* copyName)
-{
- // This method is used to create a copy of the event histograms
-
- TH1F* histCopy = new TH1F(copyName, hist->GetTitle(),
- hist->GetXaxis()->GetNbins(),
- hist->GetXaxis()->GetXmin(),
- hist->GetXaxis()->GetXmax());
- histCopy->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle());
- histCopy->GetYaxis()->SetTitle(hist->GetYaxis()->GetTitle());
- histCopy->SetMarkerStyle(20);
- histCopy->SetOption("P");
- histCopy->SetStats(kFALSE);
-
- return histCopy;
-}
// --- ROOT system ---
#include <TH1.h>
+#include <TProfile.h>
// --- Standard library ---
class AliTPCQADataMakerRec: public AliQADataMakerRec {
public:
- enum HRawsType_t {kRawsOccupancy=0, kRawsOccupancyVsSector, kRawsNClustersPerEventVsSector, kRawsQVsSector, kRawsQmaxVsSector, kRawsOccupancyVsEvent, kRawsNclustersVsEvent} ;
+ enum HRawsType_t {kRawsOccupancyVsSector=0, kRawsQVsSector, kRawsQmaxVsSector} ;
enum HDigitType_t {kDigitsADC=0} ;
- enum HRECPOINTsType_t {KClusters=0, kRatio, kPt} ;
+ enum HRECPOINTsType_t {kClusters=0, kRatio, kPt} ;
enum HESDsType_t {kQmaxShort=0, kQmaxMedium, kQmaxLong, kQShort, kQMedium, kQLong, kRow} ;
AliTPCQADataMakerRec() ; // ctor
AliTPCQADataMakerRec& operator = (const AliTPCQADataMakerRec& qadm) ;
virtual ~AliTPCQADataMakerRec();
- virtual void ResetDetector(AliQAv1::TASKINDEX_t task);
-
- Int_t GetRawMaxEvents() const { return fRawMaxEvents; }
- Int_t GetRawEventsPerBin() const { return fRawEventsPerBin; }
Int_t GetRawFirstTimeBin() const { return fRawFirstTimeBin; }
Int_t GetRawLastTimeBin() const { return fRawLastTimeBin; }
-
- void SetRawMaxEvents (Int_t value) { fRawMaxEvents = value; }
- void SetRawEventsPerBin(Int_t value) { fRawEventsPerBin = value; }
+
void SetRawRangeTime(Int_t tMin, Int_t tMax){ fRawFirstTimeBin=tMin; fRawLastTimeBin=tMax;}
-
-private:
+
+ private:
virtual void StartOfDetectorCycle() {}; // empty
virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray** list) ;
-
+
// ESD QA
virtual void InitESDs() ;
virtual void MakeESDs(AliESDEvent *esd) ;
-
+
// Raw QA
virtual void InitRaws();
virtual void MakeRaws(AliRawReader* rawReader);
-
+
// Digits QA
virtual void InitDigits();
virtual void MakeDigits() {return;}
virtual void MakeRecPoints(TTree *recTree);
virtual void LoadMaps();
-
- TH1F* CreateEventsHistCopy(const TH1F* hist, const Char_t* copyName);
-
+
AliTPCAltroMapping *fMapping[6]; //! Pointers to ALTRO mapping
- AliTPCdataQA** fTPCdataQA;//! TPC calibration object for making raw data QA
-
- Int_t fRawMaxEvents; //! Max events for RAW QA event histograms
- Int_t fRawEventsPerBin; //! Events per bin for RAW QA event histograms
+ AliTPCdataQA* fTPCdataQA;//! TPC calibration object for making raw data QA
+
Int_t fRawFirstTimeBin; //! First Time bin needed for RAW QA
Int_t fRawLastTimeBin; //! Last Time bin needed for RAW QA
-
+
ClassDef(AliTPCQADataMakerRec,1) // TPC Rec Quality Assurance Data Maker
-};
+ };
#endif // ALITPCQADATAMAKERREC_H
/* $Id$ */
/*
+ July 2011:
+
+ Changes to accomodate updates of general DQM/QA changes to have per trigger
+ histograms (for a given event specie).
+
+ AliTPCdataQA has a new flag for only keeping DQM info event by
+ event!
+ The expert/DA functionality has been kept exactly the same!
+
+
June 2010
This update should solve two problems mainly:
//Root includes
#include <TH1F.h>
-#include <TH2F.h>
#include <TString.h>
#include <TMath.h>
#include <TDirectory.h>
fAllNSigBins(0),
fRowsMax(0),
fPadsMax(0),
- fTimeBinsMax(0)
+ fTimeBinsMax(0),
+ fIsDQM(kFALSE),
+ fHistOccVsSector(0x0),
+ fHistQVsSector(0x0),
+ fHistQmaxVsSector(0x0),
+ fOccVec(0x0),
+ fOccMaxVec(0x0)
{
//
// default constructor
//
}
-//_____________________________________________________________________
-AliTPCdataQA::AliTPCdataQA(AliRecoParam::EventSpecie_t es) :
-fFirstTimeBin(60),
-fLastTimeBin(1000),
-fAdcMin(1),
-fAdcMax(100),
-fMapping(NULL),
-fPedestal(0),
-fNoise(0),
-fNLocalMaxima(0),
-fMaxCharge(0),
-fMeanCharge(0),
-fNoThreshold(0),
-fNTimeBins(0),
-fNPads(0),
-fTimePosition(0),
-fOverThreshold10(0),
-fOverThreshold20(0),
-fOverThreshold30(0),
-fHistQVsTimeSideA(0),
-fHistQVsTimeSideC(0),
-fHistQMaxVsTimeSideA(0),
-fHistQMaxVsTimeSideC(0),
-fHistOccupancyVsEvent(0),
-fHistNclustersVsEvent(0),
-fEventCounter(0),
-fIsAnalysed(kFALSE),
-fMaxEvents(500000),
-fEventsPerBin(1000),
-fSignalCounter(0),
-fClusterCounter(0),
-fAllBins(0),
-fAllSigBins(0),
-fAllNSigBins(0),
-fRowsMax(0),
-fPadsMax(0),
-fTimeBinsMax(0)
-{
-// ctor creating the histogram
- char * name = Form("TPCRAW_%s", AliRecoParam::GetEventSpecieName(es)) ;
- TH1F(name, name,100,0,100) ;
-}
-
//_____________________________________________________________________
AliTPCdataQA::AliTPCdataQA(const AliTPCdataQA &ped) : /*FOLD00*/
TH1F(ped),
fAllNSigBins(0),
fRowsMax(0),
fPadsMax(0),
- fTimeBinsMax(0)
+ fTimeBinsMax(0),
+ fIsDQM(ped.GetIsDQM()),
+ fHistOccVsSector(0x0),
+ fHistQVsSector(0x0),
+ fHistQmaxVsSector(0x0),
+ fOccVec(0x0),
+ fOccMaxVec(0x0)
{
//
// copy constructor
fAllNSigBins(0),
fRowsMax(0),
fPadsMax(0),
- fTimeBinsMax(0)
+ fTimeBinsMax(0),
+ fIsDQM(kFALSE),
+ fHistOccVsSector(0x0),
+ fHistQVsSector(0x0),
+ fHistQmaxVsSector(0x0),
+ fOccVec(0x0),
+ fOccMaxVec(0x0)
{
//
// default constructor
delete fHistOccupancyVsEvent;
delete fHistNclustersVsEvent;
+ // DQM
+ delete fHistOccVsSector;
+ delete fHistQVsSector;
+ delete fHistQmaxVsSector;
+ delete fOccVec;
+ delete fOccMaxVec;
+
for (Int_t iRow = 0; iRow < fRowsMax; iRow++) {
delete [] fAllBins[iRow];
delete [] fAllSigBins[iRow];
// NB! This has to be done first even if the data is rejected by the time
// cut to make sure that the objects are available in Analyse
//
- if (!fNLocalMaxima) fNLocalMaxima = new AliTPCCalPad("NLocalMaxima","NLocalMaxima");
- if (!fMaxCharge) fMaxCharge = new AliTPCCalPad("MaxCharge","MaxCharge");
- if (!fMeanCharge) fMeanCharge = new AliTPCCalPad("MeanCharge","MeanCharge");
- if (!fNoThreshold) fNoThreshold = new AliTPCCalPad("NoThreshold","NoThreshold");
- if (!fNTimeBins) fNTimeBins = new AliTPCCalPad("NTimeBins","NTimeBins");
- if (!fNPads) fNPads = new AliTPCCalPad("NPads","NPads");
- if (!fTimePosition) fTimePosition = new AliTPCCalPad("TimePosition","TimePosition");
- if (!fOverThreshold10) fOverThreshold10 = new AliTPCCalPad("OverThreshold10","OverThreshold10");
- if (!fOverThreshold20) fOverThreshold20 = new AliTPCCalPad("OverThreshold20","OverThreshold20");
- if (!fOverThreshold30) fOverThreshold30 = new AliTPCCalPad("OverThreshold30","OverThreshold30");
- if (!fHistQVsTimeSideA) {
- fHistQVsTimeSideA = new TProfile("hQVsTimeSideA", "Q vs time (side A); Time [Timebin]; Q [ADC ch]", 100, 0, 1000);
- fHistQVsTimeSideA->SetDirectory(0);
- }
- if (!fHistQVsTimeSideC) {
- fHistQVsTimeSideC = new TProfile("hQVsTimeSideC", "Q vs time (side C); Time [Timebin]; Q [ADC ch]", 100, 0, 1000);
- fHistQVsTimeSideC->SetDirectory(0);
- }
- if (!fHistQMaxVsTimeSideA) {
- fHistQMaxVsTimeSideA = new TProfile("hQMaxVsTimeSideA", "Q_{MAX} vs time (side A); Time [Timebin]; Q_{MAX} [ADC ch]", 100, 0, 1000);
- fHistQMaxVsTimeSideA->SetDirectory(0);
+ if(!fIsDQM) {
+
+ if (!fNLocalMaxima) fNLocalMaxima = new AliTPCCalPad("NLocalMaxima","NLocalMaxima");
+ if (!fMaxCharge) fMaxCharge = new AliTPCCalPad("MaxCharge","MaxCharge");
+ if (!fMeanCharge) fMeanCharge = new AliTPCCalPad("MeanCharge","MeanCharge");
+ if (!fNoThreshold) fNoThreshold = new AliTPCCalPad("NoThreshold","NoThreshold");
+ if (!fNTimeBins) fNTimeBins = new AliTPCCalPad("NTimeBins","NTimeBins");
+ if (!fNPads) fNPads = new AliTPCCalPad("NPads","NPads");
+ if (!fTimePosition) fTimePosition = new AliTPCCalPad("TimePosition","TimePosition");
+ if (!fOverThreshold10) fOverThreshold10 = new AliTPCCalPad("OverThreshold10","OverThreshold10");
+ if (!fOverThreshold20) fOverThreshold20 = new AliTPCCalPad("OverThreshold20","OverThreshold20");
+ if (!fOverThreshold30) fOverThreshold30 = new AliTPCCalPad("OverThreshold30","OverThreshold30");
+ if (!fHistQVsTimeSideA) {
+ fHistQVsTimeSideA = new TProfile("hQVsTimeSideA", "Q vs time (side A); Time [Timebin]; Q [ADC ch]", 100, 0, 1000);
+ fHistQVsTimeSideA->SetDirectory(0);
+ }
+ if (!fHistQVsTimeSideC) {
+ fHistQVsTimeSideC = new TProfile("hQVsTimeSideC", "Q vs time (side C); Time [Timebin]; Q [ADC ch]", 100, 0, 1000);
+ fHistQVsTimeSideC->SetDirectory(0);
}
- if (!fHistQMaxVsTimeSideC) {
- fHistQMaxVsTimeSideC = new TProfile("hQMaxVsTimeSideC", "Q_{MAX} vs time (side C); Time [Timebin]; Q_{MAX} [ADC ch]", 100, 0, 1000);
- fHistQMaxVsTimeSideC->SetDirectory(0);
+ if (!fHistQMaxVsTimeSideA) {
+ fHistQMaxVsTimeSideA = new TProfile("hQMaxVsTimeSideA", "Q_{MAX} vs time (side A); Time [Timebin]; Q_{MAX} [ADC ch]", 100, 0, 1000);
+ fHistQMaxVsTimeSideA->SetDirectory(0);
+ }
+ if (!fHistQMaxVsTimeSideC) {
+ fHistQMaxVsTimeSideC = new TProfile("hQMaxVsTimeSideC", "Q_{MAX} vs time (side C); Time [Timebin]; Q_{MAX} [ADC ch]", 100, 0, 1000);
+ fHistQMaxVsTimeSideC->SetDirectory(0);
+ }
+ } else { // DQM histograms and array
+
+ if (!fHistOccVsSector) {
+ fHistOccVsSector = new TProfile("hOccVsSector", "Occupancy vs sector; Sector; Occupancy", 72, 0, 72);
+ fHistOccVsSector->SetDirectory(0);
+
+ fHistQVsSector = new TProfile("hQVsSector", "Q vs sector; Sector; Q [ADC ch]", 72, 0, 72);
+ fHistQVsSector->SetDirectory(0);
+
+ fHistQmaxVsSector = new TProfile("hQmaxVsSector", "Qmax vs sector; Sector; Qmax [ADC ch]", 72, 0, 72);
+ fHistQmaxVsSector->SetDirectory(0);
+
+ fOccVec = new TArrayD(72);
+ for(Int_t i = 0; i < 72; i++)
+ fOccVec->GetArray()[i] = 0;
+
+ fOccMaxVec = new TArrayD(72);
+ Double_t nTimeBins = fLastTimeBin - fFirstTimeBin +1;
+ for(Int_t i = 0; i < 72; i++)
+
+ if(i<36) // IROCs (5504 pads)
+ fOccMaxVec->GetArray()[i] = nTimeBins*5504;
+ else // OROCs (9984 pads)
+ fOccMaxVec->GetArray()[i] = nTimeBins*9984;
+ }
}
-
// Make the arrays for expanding the data
if (!fAllBins)
// If Analyse has been previously called we need now to denormalize the data
// as more data is coming
//
- if(fIsAnalysed == kTRUE) {
+ if(fIsAnalysed == kTRUE && !fIsDQM) {
const Int_t nTimeBins = fLastTimeBin - fFirstTimeBin +1;
const Float_t denormalization = Float_t(fEventCounter * nTimeBins);
signal -= ped;
}
- // In fNoThreshold we fill all data to estimate the ZS volume
- Float_t count = fNoThreshold->GetCalROC(iSector)->GetValue(iRow, iPad);
- fNoThreshold->GetCalROC(iSector)->SetValue(iRow, iPad,count+1);
-
+ if(fIsDQM) {
+
+ fOccVec->GetArray()[iSector] += 1.0;
+ } else {
+ // In fNoThreshold we fill all data to estimate the ZS volume
+ Float_t count = fNoThreshold->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fNoThreshold->GetCalROC(iSector)->SetValue(iRow, iPad,count+1);
+ }
+
// Require at least 3 ADC channels
if (signal < 3.0)
return 0;
Int_t iPad, iTimeBin;
GetPadAndTimeBin(bin, iPad, iTimeBin);
- Float_t count = fNLocalMaxima->GetCalROC(iSector)->GetValue(iRow, iPad);
- fNLocalMaxima->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
-
- count = fTimePosition->GetCalROC(iSector)->GetValue(iRow, iPad);
- fTimePosition->GetCalROC(iSector)->SetValue(iRow, iPad, count+iTimeBin);
+ if(!fIsDQM) {
+ Float_t count = fNLocalMaxima->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fNLocalMaxima->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
+
+ count = fTimePosition->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fTimePosition->GetCalROC(iSector)->SetValue(iRow, iPad, count+iTimeBin);
- Float_t charge = fMaxCharge->GetCalROC(iSector)->GetValue(iRow, iPad);
- fMaxCharge->GetCalROC(iSector)->SetValue(iRow, iPad, charge + qMax);
-
- if(qMax>=10) {
- count = fOverThreshold10->GetCalROC(iSector)->GetValue(iRow, iPad);
- fOverThreshold10->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
- }
- if(qMax>=20) {
- count = fOverThreshold20->GetCalROC(iSector)->GetValue(iRow, iPad);
- fOverThreshold20->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
- }
- if(qMax>=30) {
- count = fOverThreshold30->GetCalROC(iSector)->GetValue(iRow, iPad);
- fOverThreshold30->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
+ Float_t charge = fMaxCharge->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fMaxCharge->GetCalROC(iSector)->SetValue(iRow, iPad, charge + qMax);
+
+ if(qMax>=10) {
+ count = fOverThreshold10->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fOverThreshold10->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
+ }
+ if(qMax>=20) {
+ count = fOverThreshold20->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fOverThreshold20->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
+ }
+ if(qMax>=30) {
+ count = fOverThreshold30->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fOverThreshold30->GetCalROC(iSector)->SetValue(iRow, iPad, count+1);
+ }
}
//
}
}
- charge = fMeanCharge->GetCalROC(iSector)->GetValue(iRow, iPad);
- fMeanCharge->GetCalROC(iSector)->SetValue(iRow, iPad, charge + qTot);
-
- count = fNTimeBins->GetCalROC(iSector)->GetValue(iRow, iPad);
- fNTimeBins->GetCalROC(iSector)->SetValue(iRow, iPad, count + maxT-minT+1);
-
- count = fNPads->GetCalROC(iSector)->GetValue(iRow, iPad);
- fNPads->GetCalROC(iSector)->SetValue(iRow, iPad, count + maxP-minP+1);
-
- if((iSector%36)<18) { // A side
- fHistQVsTimeSideA->Fill(iTimeBin, qTot);
- fHistQMaxVsTimeSideA->Fill(iTimeBin, qMax);
+ if(fIsDQM) {
+ fHistQVsSector->Fill(iSector, qTot);
+ fHistQmaxVsSector->Fill(iSector, qMax);
} else {
- fHistQVsTimeSideC->Fill(iTimeBin, qTot);
- fHistQMaxVsTimeSideC->Fill(iTimeBin, qMax);
+ Float_t charge = fMeanCharge->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fMeanCharge->GetCalROC(iSector)->SetValue(iRow, iPad, charge + qTot);
+
+ Float_t count = fNTimeBins->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fNTimeBins->GetCalROC(iSector)->SetValue(iRow, iPad, count + maxT-minT+1);
+
+ count = fNPads->GetCalROC(iSector)->GetValue(iRow, iPad);
+ fNPads->GetCalROC(iSector)->SetValue(iRow, iPad, count + maxP-minP+1);
+
+ if((iSector%36)<18) { // A side
+ fHistQVsTimeSideA->Fill(iTimeBin, qTot);
+ fHistQMaxVsTimeSideA->Fill(iTimeBin, qMax);
+ } else {
+ fHistQVsTimeSideC->Fill(iTimeBin, qTot);
+ fHistQMaxVsTimeSideC->Fill(iTimeBin, qMax);
+ }
}
} // end loop over signals
} // end loop over rows
AliInfo("Analyse called");
+ if(fIsDQM == kTRUE) {
+
+ AliInfo("DQM flas is set -> No 2d information to analyze");
+ return;
+ }
+
if(fIsAnalysed == kTRUE) {
AliInfo("No new data since Analyse was called last time");
fAllNSigBins[iRow]++;
}
+//______________________________________________________________________________
Float_t AliTPCdataQA::GetQ(const Float_t* adcArray, const Int_t time,
const Int_t pad, const Int_t maxTimeBins,
Int_t& timeMin, Int_t& timeMax,
AliTPCdataQA::Class()->WriteBuffer(xRuub,this);
}
}
+
+//____________________________________________________________________________________________
+void AliTPCdataQA::FillOccupancyProfile()
+{
+ // This has to be filled at the end of the loop over data
+ if(!fIsDQM)
+ AliInfo("Method only meaningful for DQM");
+
+ for(Int_t i = 0; i < 72; i++) {
+
+ fOccVec->GetArray()[i] /= fOccMaxVec->GetArray()[i];
+ fHistOccVsSector->Fill(i, fOccVec->GetArray()[i]);
+ }
+}
+
+//____________________________________________________________________________________________
+void AliTPCdataQA::ResetProfiles()
+{
+ if(!fIsDQM)
+ AliInfo("Method only meaningful for DQM");
+
+ if(fHistQVsSector)
+ fHistQVsSector->Reset();
+ if(fHistQmaxVsSector)
+ fHistQmaxVsSector->Reset();
+ if(fHistOccVsSector)
+ fHistOccVsSector->Reset();
+
+ if(fOccVec)
+ for(Int_t i = 0; i < 72; i++)
+ fOccVec->GetArray()[i] = 0.0;
+}
class TProfile;
#include "AliRecoParam.h"
-class TArrayF;
+#include <TArray.h>
+
class TH2F;
class TTreeSRedirector;
class AliTPCROC;
public:
AliTPCdataQA();
- AliTPCdataQA(AliRecoParam::EventSpecie_t es);
AliTPCdataQA(const AliTPCdataQA &ped);
AliTPCdataQA(const TMap *config);
virtual ~AliTPCdataQA();
void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
+ // DQM methods
+ void FillOccupancyProfile();
+ void ResetProfiles();
+
+
AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
TH1F* GetHistOccupancyVsEvent();
TH1F* GetHistNclustersVsEvent();
+ // DQM output
+ TProfile* GetHistOccVsSector() const { return fHistOccVsSector; }
+ TProfile* GetHistQVsSector() const { return fHistQVsSector; }
+ TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
+
//
AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
Int_t GetSignalCounter() const { return fSignalCounter; }
Int_t GetClusterCounter() const { return fClusterCounter;}
+ // DQM getter
+ Bool_t GetIsDQM() const { return fIsDQM; }
+
void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
void SetMaxEvents (Int_t value) { fMaxEvents = value; }
void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
+
+ // DQM setter
+ void SetIsDQM(Bool_t value) { fIsDQM = value; }
private:
Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
Int_t fPadsMax; //! Maximum number of time bins
Int_t fTimeBinsMax; //! Maximum number of time bins
+ // DQM variables
+ Bool_t fIsDQM; //! Is DQM -> Simple output (no 2D!)
+ TProfile* fHistOccVsSector; //! Occ vs sector (for DQM only)
+ TProfile* fHistQVsSector; //! Q vs sector (for DQM only)
+ TProfile* fHistQmaxVsSector; //! QMax vs sector (for DQM only)
+ TArrayD* fOccVec; //! Occupancy help counter for DQM
+ TArrayD* fOccMaxVec; //! Occupancy help normlization for DQM
+
+
ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA
};