void processContainer(TObject* object, TTreeSRedirector* debugStreamer, TString name); void loadLibraries(); void simpleTrending(TString inputFileName, Int_t run, TString filterExpr=".*", TString trendingFileName="trending.root", TString treeName="trending", TString fileOpenMode="update" ); TString treeName; void simpleTrending(TString inputFileName, Int_t run, TString filterExpr, TString trendingFileName, TString debugTreeName, TString fileOpenMode ) { // Dump the statistical information about all histograms in the file // into a tree // // // 1. Default dump for all histograms // Information to dump: // stat =Entries, Mean, MeanError, RMS, MaxBin // Branch naming convention: // _ // // 2. Detector statistical information - to be implemented by expert // - First version implemented by MI // - updated for QA by MK // // loadLibraries(); treeName=debugTreeName; TFile *inputFile = TFile::Open(inputFileName.Data()); if (!inputFile) return; TList * keyList = inputFile->GetListOfKeys(); Int_t nkeys=keyList->GetEntries(); TRegexp filterRegexp=filterExpr.Data(); //check if we have a matching container, only then create the output file TList* keyList=inputFile->GetListOfKeys(); Int_t nkeys=keyList->GetEntries(); Bool_t containerExists=kFALSE; for (Int_t i=0; iAt(i); if (!object) continue; TString name=object->GetName(); if (name.Contains(filterRegexp)) { containerExists=kTRUE; break; } } if (!containerExists) { printf("container %s does not exist in %s\n",filterExpr.Data(),inputFileName.Data()); return; } TTreeSRedirector *pcstream = new TTreeSRedirector(trendingFileName,fileOpenMode); (*pcstream)<Get(keyList->At(i)->GetName()); if (!object) continue; TString name=object->GetName(); if (!name.Contains(filterRegexp)) continue; processContainer(object,pcstream,name); } // // Expert dump example (MI first iteration): // // 0.) TOF dump // Int_t tofEvents=0; Int_t tofTracks=0; TList * TOFCalib = (TList*)inputFile->Get("TOFHistos"); if (TOFCalib) { TH1 *histoEvents = (TH1*)TOFCalib->FindObject("hHistoVertexTimestamp"); TH1 *histoTracks = (TH1*)TOFCalib->FindObject("hHistoDeltatTimestamp"); if (histoEvents && histoTracks){ tofEvents = TMath::Nint(histoEvents->GetEntries()); tofTracks = TMath::Nint(histoTracks->GetEntries()); } delete TOFCalib; } printf("Monalisa TOFevents\t%d\n",tofEvents); if (pcstream) (*pcstream)<(obj); TDirectory* dir = dynamic_cast(obj); AliTPCcalibTime * calibTime = NULL; if (dir) { calibTime = dynamic_cast(dir->Get("calibTime")); } else if (array){ calibTime = (AliTPCcalibTime *)array->FindObject("calibTime"); } if (calibTime) { tpcEvents = TMath::Nint(calibTime->GetTPCVertexHisto(0)->GetEntries()); tpcTracks = TMath::Nint(calibTime->GetResHistoTPCITS(0)->GetEntries()); } printf("Monalisa TPCevents\t%d\n",tpcEvents); if (pcstream) (*pcstream)<FindObject("NEventsInput_AliTRDCalibTask"); TH1 *histoTracks = (TH1*)TRDCalib->FindObject("AbsoluteGain_AliTRDCalibTask"); if (histoEvents && histoTracks){ trdEvents= TMath::Nint(histoEvents->GetEntries()); trdTracks= TMath::Nint(histoTracks->GetEntries()); } delete TRDCalib; } printf("Monalisa TRDevents\t%d\n",trdEvents); if (pcstream) (*pcstream)<FindObject("fTzeroORAplusORC"); if (histoEvents){ T0Events= TMath::Nint(histoEvents->GetEntries()); } delete T0Calib; } printf("Monalisa T0events\t%d\n",T0Events); if (pcstream) (*pcstream)<Get("MeanVertex"); if (meanVertexCalib) { TH1 *histoEvents = (TH1*) meanVertexCalib->FindObject("hTRKVertexX"); if (histoEvents){ meanVertexEvents = TMath::Nint(histoEvents->GetEntries()); } delete meanVertexCalib; } printf("Monalisa MeanVertexevents\t%d\n",meanVertexEvents); if (pcstream) (*pcstream)<Get("clistSDDCalib"); if (SDDCalib) { TH1 *histoEvents = (TH1*) SDDCalib->FindObject("hNEvents"); if (histoEvents ){ sddEvents = TMath::Nint(histoEvents->GetBinContent(4)); sddTracks = TMath::Nint(histoEvents->GetBinContent(5)); } delete SDDCalib; } printf("Monalisa SDDevents\t%d\n",sddEvents); if (pcstream) (*pcstream)<GetName(); //TDirectory* inputDir=dynamic_cast(inputObject); //TSeqCollection* inputCollection=dynamic_cast(inputObject); //TH1* inputHistogram=dynamic_cast(inputObject); if (inputObject->InheritsFrom("TDirectory")) inputDir=dynamic_cast(inputObject); if (inputObject->InheritsFrom("TSeqCollection")) inputCollection=dynamic_cast(inputObject); if (inputObject->InheritsFrom("TH1")) inputHistogram=dynamic_cast(inputObject); if (inputCollection) { printf("processing collection: %s\n",inputCollection->GetName()); Int_t nentries= inputCollection->GetEntries(); for (Int_t i=0; iAt(i); if (!object) continue; TString name=parentname+"/"+object->GetName(); processContainer(object,pcstream,name); } } else if (inputDir) { printf("processing directory: %s\n",inputDir->GetName()); TList* keyList=inputDir->GetListOfKeys(); Int_t nkeys=keyList->GetEntries(); for (Int_t i=0; iGet(keyList->At(i)->GetName()); if (!object) continue; TString name=parentname+"/"+object->GetName(); processContainer(object,pcstream,name); } } else if (inputHistogram) { Double_t hisEntries; Double_t hisMean; Double_t hisMeanError; Double_t hisRMS; Double_t hisMaxBin; if (inputHistogram->InheritsFrom("TH1")==0) continue; TH1* phis = (TH1*)inputHistogram; hisEntries=phis->GetEntries(); Int_t idim=1; if (inputHistogram->InheritsFrom("TH2")) idim=2; if (inputHistogram->InheritsFrom("TH3")) idim=3; hisMean=phis->GetMean(idim); hisMeanError=phis->GetMeanError(idim); hisRMS=phis->GetRMS(idim); hisMaxBin=phis->GetBinCenter(phis->GetMaximumBin()); TString name=parentname; printf("histogram: %s\n",name.Data()); if (pcstream) (*pcstream)<Load("libANALYSIS"); gSystem->Load("libANALYSISalice"); gSystem->Load("libANALYSIScalib"); gSystem->Load("libESDfilter"); gSystem->Load("libCORRFW"); gSystem->Load("libTENDER"); gSystem->Load("libPWGPP.so"); gSystem->Load("libAliHLTTrigger.so"); gSystem->Load("libPWGTools"); gSystem->Load("libEMCALUtils"); gSystem->Load("libPHOSUtils"); gSystem->Load("libPWGCaloTrackCorrBase"); gSystem->Load("libPWGGACaloTrackCorrelations"); gSystem->Load("libPWGGACaloTasks"); gSystem->Load("libPWGGAPHOSTasks"); gSystem->Load("libPWGTools"); gSystem->Load("libPWGEMCAL"); gSystem->Load("libPWGGAEMCALTasks"); gSystem->Load("libPWGmuon"); gSystem->Load("libPWGPPMUONlite"); gSystem->Load("libPWGmuondep"); gSystem->Load("libPWGLFforward2"); }