From 61f6b45ee0424c6ead470bca0cf1589d282c4ab2 Mon Sep 17 00:00:00 2001 From: abercuci Date: Thu, 26 Aug 2010 09:43:40 +0000 Subject: [PATCH] fix codding conventions. Still to be done: info/AliTRDv0Info.viol : 11 AliTRDcheckDET.viol : 3 AliTRDcheckESD.viol : 12 AliTRDpidRefMakerNN.viol : 6 --- PWG1/TRD/AliTRDinfoGen.cxx | 4 +- PWG1/TRD/AliTRDinfoGen.h | 6 +- PWG1/TRD/AliTRDpwg1Helper.cxx | 62 +++++++++++++++---- PWG1/TRD/AliTRDpwg1Helper.h | 24 ++++++-- PWG1/TRD/AliTRDresolution.cxx | 82 ++++++++++++++----------- PWG1/TRD/AliTRDresolution.h | 7 ++- PWG1/TRD/info/AliTRDclusterInfo.cxx | 12 ++++ PWG1/TRD/info/AliTRDclusterInfo.h | 22 +++---- PWG1/TRD/info/AliTRDeventInfo.cxx | 15 ++++- PWG1/TRD/info/AliTRDeventInfo.h | 17 ++++- PWG1/TRD/info/AliTRDpidInfo.cxx | 10 +++ PWG1/TRD/info/AliTRDpidInfo.h | 13 +++- PWG1/TRD/info/AliTRDtrackInfo.cxx | 7 ++- PWG1/TRD/info/AliTRDtrackInfo.h | 2 +- PWG1/TRD/info/AliTRDtrendValue.cxx | 47 +++++++++----- PWG1/TRD/info/AliTRDtrendValue.h | 24 +++++--- PWG1/TRD/info/AliTRDtrendingManager.cxx | 22 +++++-- PWG1/TRD/info/AliTRDtrendingManager.h | 16 +++-- 18 files changed, 283 insertions(+), 109 deletions(-) diff --git a/PWG1/TRD/AliTRDinfoGen.cxx b/PWG1/TRD/AliTRDinfoGen.cxx index c4e6b885211..b1777cba7a3 100644 --- a/PWG1/TRD/AliTRDinfoGen.cxx +++ b/PWG1/TRD/AliTRDinfoGen.cxx @@ -202,6 +202,7 @@ AliTRDinfoGen::~AliTRDinfoGen() //____________________________________________________________________ Bool_t AliTRDinfoGen::GetRefFigure(Int_t) { +// General graphs for PWG1/TRD train if(!gPad){ AliWarning("Please provide a canvas to draw results."); return kFALSE; @@ -686,7 +687,7 @@ void AliTRDinfoGen::UserExec(Option_t *){ } //____________________________________________________________________ -void AliTRDinfoGen::SetLocalV0Selection(AliTRDv0Info *v0) +void AliTRDinfoGen::SetLocalV0Selection(const AliTRDv0Info *v0) { // Set V0 cuts from outside @@ -704,6 +705,7 @@ void AliTRDinfoGen::SetTrigger(const Char_t *trigger) //____________________________________________________________________ TTreeSRedirector* AliTRDinfoGen::DebugStream() { +// Manage debug stream for task if(!fDebugStream){ TDirectory *savedir = gDirectory; fDebugStream = new TTreeSRedirector("TRD.DebugInfoGen.root"); diff --git a/PWG1/TRD/AliTRDinfoGen.h b/PWG1/TRD/AliTRDinfoGen.h index 00e46bafb06..09af87ebc7f 100644 --- a/PWG1/TRD/AliTRDinfoGen.h +++ b/PWG1/TRD/AliTRDinfoGen.h @@ -60,11 +60,11 @@ public: static AliTRDgeometry* Geometry() {return fgGeo;} void SetInitOCDB(Bool_t set=kTRUE) {SetBit(kOCDB, set);} void SetCollision(Bool_t set=kTRUE) {SetBit(kCollision, set);} - void SetLocalEvSelection(AliTRDeventCuts */*cut*/){;} + //void SetLocalEvSelection(const AliTRDeventCuts */*cut*/){;} void SetLocalEvSelection(Bool_t use=kTRUE) {SetBit(kUseLocalEvSelection, use);} - void SetLocalTrkSelection(AliESDtrackCuts */*cut*/){;} + //void SetLocalTrkSelection(const AliESDtrackCuts */*cut*/){;} void SetLocalTrkSelection(Bool_t use=kTRUE) {SetBit(kUseLocalTrkSelection, use);} - void SetLocalV0Selection(AliTRDv0Info *v0); + void SetLocalV0Selection(const AliTRDv0Info *v0); void SetMCdata(Bool_t mc = kTRUE) {SetBit(kMCdata, mc);} void SetOCDB(const char *ocdb) {fOCDB=ocdb;} void SetTrigger(const Char_t *trigger); diff --git a/PWG1/TRD/AliTRDpwg1Helper.cxx b/PWG1/TRD/AliTRDpwg1Helper.cxx index 187fee30b56..11e7a49db08 100644 --- a/PWG1/TRD/AliTRDpwg1Helper.cxx +++ b/PWG1/TRD/AliTRDpwg1Helper.cxx @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// Helper class for PWG1 TRD train // +// // +// Authors: // +// Markus Fasel // +// // +//////////////////////////////////////////////////////////////////////////// + #include #include #include @@ -45,7 +54,29 @@ const Char_t * AliTRDpwg1Helper::fgkTRDtaskOpt[AliTRDpwg1Helper::kNTRDTASKS+1] = }; //______________________________________________________ -Int_t AliTRDpwg1Helper::ParseOptions(Char_t *trd){ +Int_t AliTRDpwg1Helper::ParseOptions(Char_t *trd) +{ +// Parse space separated options. +// Possible options are: +// "ALL" : [default] all performance (no calibration) tasks +// ------- Performance tasks ---------- +// "ESD" : Basic TRD Detector checks on ESD only (no TRD tracks analysed) +// "DET" : Basic TRD Detector checks +// "RES" : TRD tracking Resolution +// "EFF" : TRD Tracking Efficiency +// "PID" : TRD PID - pion efficiency +// "V0" : monitor V0 performance for use in TRD PID calibration +// ------- Calibration tasks ---------- +// "EFFC" : TRD Tracking Efficiency Combined (barrel + stand alone) - only in case of simulations +// "MULT" : TRD single track selection +// "CLRES": clusters Resolution +// "CAL" : TRD calibration +// "ALGN" : TRD alignment +// "PIDR" : TRD PID - reference data +// ------- SPECIAL OPTIONS ----------- +// "NOFR" : Data set does not have AliESDfriends.root +// "NOMC" : Data set does not have Monte Carlo Informations (default have MC), + Int_t fSteerTask = 0; TObjArray *tasksArray = TString(trd).Tokenize(" "); for(Int_t isel = 0; isel < tasksArray->GetEntriesFast(); isel++){ @@ -83,11 +114,10 @@ Int_t AliTRDpwg1Helper::ParseOptions(Char_t *trd){ //______________________________________________________ void AliTRDpwg1Helper::MergeProd(const Char_t *mark, const Char_t *files, const Int_t nBatch = 20) { +// Merge Output files named "mark" from list in "files" - - // Clear first predefines - Char_t MERGE[8]; sprintf(MERGE, "%d.lst", (Int_t)gRandom->Uniform(9999.)); - Char_t PURGE[8]; sprintf(PURGE, "%d.lst", (Int_t)gRandom->Uniform(9999.)); + Char_t lMERGE[8]; sprintf(lMERGE, "%d.lst", (Int_t)gRandom->Uniform(9999.)); + Char_t lPURGE[8]; sprintf(lPURGE, "%d.lst", (Int_t)gRandom->Uniform(9999.)); gSystem->Exec("mkdir -p merge; rm -rf merge/*"); // purge file list @@ -96,25 +126,27 @@ void AliTRDpwg1Helper::MergeProd(const Char_t *mark, const Char_t *files, const Int_t iline(0); while(getline(file, filename)){ if(Int_t(filename.find(mark)) < 0) continue; - gSystem->Exec(Form("echo %s >> %s", filename.c_str(), PURGE)); + gSystem->Exec(Form("echo %s >> %s", filename.c_str(), lPURGE)); iline++; } Int_t nBatches(iline/nBatch); for(Int_t ibatch(0); ibatchExec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, %d)\'", mark, PURGE, nBatch, first))) continue; + if(!gSystem->Exec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, %d)\'", mark, lPURGE, nBatch, first))) continue; gSystem->Exec(Form("mv %d_%s merge/", first, mark)); - gSystem->Exec(Form("echo %s/merge/%d_%s >> %s", gSystem->ExpandPathName("$PWD"), first, mark, MERGE)); + gSystem->Exec(Form("echo %s/merge/%d_%s >> %s", gSystem->ExpandPathName("$PWD"), first, mark, lMERGE)); } - gSystem->Exec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, 0, kFALSE, kTRUE)\'", mark, MERGE, nBatches)); + gSystem->Exec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, 0, kFALSE, kTRUE)\'", mark, lMERGE, nBatches)); gSystem->Exec(Form("mv 0_%s %s", mark, mark)); - gSystem->Exec(Form("rm -rfv %s %s merge", MERGE, PURGE)); + gSystem->Exec(Form("rm -rfv %s %s merge", lMERGE, lPURGE)); } //______________________________________________________ -Int_t AliTRDpwg1Helper::GetTaskIndex(const Char_t *name){ +Int_t AliTRDpwg1Helper::GetTaskIndex(const Char_t *name) +{ +// Give index in TRD train of task class "name" for(Int_t it(0); it // +// // +//////////////////////////////////////////////////////////////////////////// + class AliTRDpwg1Helper{ public: enum ETRDinfoGenOutSlots { @@ -34,18 +43,25 @@ public: kNTRDCALIBTASKS = 6, kNTRDTASKS = kNTRDQATASKS + kNTRDCALIBTASKS }; - static const Char_t * fgkTRDtaskOpt[kNTRDTASKS + 1]; - static const Char_t * fgkTRDtaskClassName[kNTRDTASKS]; + + AliTRDpwg1Helper(); + ~AliTRDpwg1Helper(); static Int_t GetTaskIndex(const Char_t *name); static Bool_t HasReadMCData(Char_t *opt); static Bool_t HasReadFriendData(Char_t *opt); + static const Char_t * TaskOpt(Int_t itask) {return fgkTRDtaskOpt[itask];} + static const Char_t * TaskClassName(Int_t itask) {return fgkTRDtaskClassName[itask];} static void MergeProd(const Char_t *mark, const Char_t *files, Int_t nBatch); static Int_t ParseOptions(Char_t *trd); - AliTRDpwg1Helper(); - ~AliTRDpwg1Helper(); +private: + AliTRDpwg1Helper(const AliTRDpwg1Helper& ref); + const AliTRDpwg1Helper& operator=(const AliTRDpwg1Helper& ref); + + static const Char_t * fgkTRDtaskOpt[kNTRDTASKS + 1]; //! task options + static const Char_t * fgkTRDtaskClassName[kNTRDTASKS];//! task class name }; #endif diff --git a/PWG1/TRD/AliTRDresolution.cxx b/PWG1/TRD/AliTRDresolution.cxx index 085705dc465..9cc47f2a373 100644 --- a/PWG1/TRD/AliTRDresolution.cxx +++ b/PWG1/TRD/AliTRDresolution.cxx @@ -105,6 +105,12 @@ Char_t const * AliTRDresolution::fgPerformanceName[kNviews] = { ,"TRDout2MC" ,"TRD2MC" }; +Char_t const * AliTRDresolution::fgParticle[11]={ + " p bar", " K -", " #pi -", " #mu -", " e -", + " No PID", + " e +", " #mu +", " #pi +", " K +", " p", +}; + // Configure segmentation for y resolution/residuals Int_t const AliTRDresolution::fgkNresYsegm[3] = { AliTRDgeometry::kNsector @@ -193,7 +199,9 @@ void AliTRDresolution::UserCreateOutputObjects() //________________________________________________________ void AliTRDresolution::InitExchangeContainers() { - fCl = new TObjArray(); +// Init containers for subsequent tasks (AliTRDclusterResolution) + + fCl = new TObjArray(200); fCl->SetOwner(kTRUE); fMCcl = new TObjArray(); fMCcl->SetOwner(kTRUE); @@ -222,7 +230,7 @@ void AliTRDresolution::UserExec(Option_t *opt) } //________________________________________________________ -Bool_t AliTRDresolution::Pulls(Double_t dyz[2], Double_t cov[3], Double_t tilt) +Bool_t AliTRDresolution::Pulls(Double_t dyz[2], Double_t cov[3], Double_t tilt) const { // Helper function to calculate pulls in the yz plane // using proper tilt rotation @@ -877,14 +885,14 @@ TH1* AliTRDresolution::PlotMC(const AliTRDtrackV1 *track) Double_t covR[7]/*, cov[3]*/; if(DebugLevel()>=3){ - TVectorD dX(12), dY(12), dZ(12), Pt(12), dPt(12), cCOV(12*15); - fkMC->PropagateKalman(&dX, &dY, &dZ, &Pt, &dPt, &cCOV); + TVectorD dX(12), dY(12), dZ(12), vPt(12), dPt(12), cCOV(12*15); + fkMC->PropagateKalman(&dX, &dY, &dZ, &vPt, &dPt, &cCOV); (*DebugStream()) << "MCkalman" << "pdg=" << pdg << "dx=" << &dX << "dy=" << &dY << "dz=" << &dZ - << "pt=" << &Pt + << "pt=" << &vPt << "dpt=" << &dPt << "cov=" << &cCOV << "\n"; @@ -1915,12 +1923,12 @@ void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range) Int_t bmax(h1.GetMaximumBin()); Int_t jBinMin(1), jBinMax(100); for(Int_t ibin(bmax); ibin--;){ - if(h1.GetBinContent(ibin)==0){ + if(h1.GetBinContent(ibin)<1.){ jBinMin=ibin; break; } } for(Int_t ibin(bmax); ibin++;){ - if(h1.GetBinContent(ibin)==0){ + if(h1.GetBinContent(ibin)<1.){ jBinMax=ibin; break; } } @@ -1936,6 +1944,8 @@ void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range) //________________________________________________________ void AliTRDresolution::MakeSummaryPlot(TObjArray *a, TH2 *h2) { +// Core functionality for MakeSummary function. + h2->Reset(); Double_t x,y; TGraphErrors *g(NULL); TAxis *ax(h2->GetXaxis()); @@ -1950,33 +1960,33 @@ void AliTRDresolution::MakeSummaryPlot(TObjArray *a, TH2 *h2) //________________________________________________________ -Char_t const *fgParticle[11]={ - " p bar", " K -", " #pi -", " #mu -", " e -", - " No PID", - " e +", " #mu +", " #pi +", " K +", " p", -}; -const Color_t fgColorS[11]={ -kOrange, kOrange-3, kMagenta+1, kViolet, kRed, -kGray, -kRed, kViolet, kMagenta+1, kOrange-3, kOrange -}; -const Color_t fgColorM[11]={ -kCyan-5, kAzure-4, kBlue-7, kBlue+2, kViolet+10, -kBlack, -kViolet+10, kBlue+2, kBlue-7, kAzure-4, kCyan-5 -}; -const Marker_t fgMarker[11]={ -30, 30, 26, 25, 24, -28, -20, 21, 22, 29, 29 -}; Bool_t AliTRDresolution::PostProcess() { - //fContainer = dynamic_cast(GetOutputData(0)); +// Fit, Project, Combine, Extract values from the containers filled during execution + + /*fContainer = dynamic_cast(GetOutputData(0));*/ if (!fContainer) { AliError("ERROR: list not available"); return kFALSE; } + + // define general behavior parameters + const Color_t fgColorS[11]={ + kOrange, kOrange-3, kMagenta+1, kViolet, kRed, + kGray, + kRed, kViolet, kMagenta+1, kOrange-3, kOrange + }; + const Color_t fgColorM[11]={ + kCyan-5, kAzure-4, kBlue-7, kBlue+2, kViolet+10, + kBlack, + kViolet+10, kBlue+2, kBlue-7, kAzure-4, kCyan-5 + }; + const Marker_t fgMarker[11]={ + 30, 30, 26, 25, 24, + 28, + 20, 21, 22, 29, 29 + }; + TGraph *gm= NULL, *gs= NULL; if(!fGraphS && !fGraphM){ TObjArray *aM(NULL), *aS(NULL); @@ -2294,11 +2304,11 @@ TObjArray* AliTRDresolution::BuildMonitorContainerTrack(const char* name) const Int_t kNpt(14); const Int_t kNdpt(150); const Int_t kNspc = 2*AliPID::kSPECIES+1; - Float_t Pt=0.1, DPt=-.1, Spc=-5.5; + Float_t lPt=0.1, lDPt=-.1, lSpc=-5.5; Float_t binsPt[kNpt+1], binsSpc[kNspc+1], binsDPt[kNdpt+1]; - for(Int_t i=0;iAddAt(arr = new TObjArray(2), kCharge); diff --git a/PWG1/TRD/AliTRDresolution.h b/PWG1/TRD/AliTRDresolution.h index 7e79414e390..56c8b7d4022 100644 --- a/PWG1/TRD/AliTRDresolution.h +++ b/PWG1/TRD/AliTRDresolution.h @@ -63,7 +63,7 @@ public: void UserCreateOutputObjects(); Float_t GetPtThreshold() const {return fPtThreshold;} - Float_t GetSegmentationLevel() {return fSegmentLevel;} + Float_t GetSegmentationLevel() const {return fSegmentLevel;} Bool_t GetRefFigure(Int_t ifig); TObjArray* Histos(); Bool_t Load(const Char_t *file = "AnalysisResults.root", const Char_t *dir="TRD_Performance"); @@ -111,7 +111,7 @@ private: Bool_t Process3DL(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL, Float_t scale=1.); Bool_t Process3Darray(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL, Float_t scale=1.); Bool_t Process3DlinkedArray(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=NULL, Float_t scale=1.); - Bool_t Pulls(Double_t dyz[2], Double_t cc[3], Double_t tilt); + Bool_t Pulls(Double_t dyz[2], Double_t cc[3], Double_t tilt) const; UChar_t fSegmentLevel; // segmentation level [sector/stack/chamber] UShort_t fIdxPlot; // plot counter (internal) @@ -120,8 +120,9 @@ private: Char_t *fAxTitle[kNprojs][4]; //! Title for all ref histos Float_t fPtThreshold; // pt threshold for some performance plots static Char_t const *fgPerformanceName[kNviews]; //! name of performance plot + static Char_t const *fgParticle[11]; //! latex name of particles/sign static UChar_t const fgNproj[kNviews]; //! number of projections per task - static Int_t const fgkNresYsegm[3]; //! number of segments for saving y resolution + static Int_t const fgkNresYsegm[3]; //! number of segments for saving y resolution static Char_t const *fgkResYsegmName[3];//! name of segment for saving y resolution TDatabasePDG *fDBPDG; // PDG database TObjArray *fGraphS; //! result holder - sigma values diff --git a/PWG1/TRD/info/AliTRDclusterInfo.cxx b/PWG1/TRD/info/AliTRDclusterInfo.cxx index da3de30fbfa..675107c8ab3 100644 --- a/PWG1/TRD/info/AliTRDclusterInfo.cxx +++ b/PWG1/TRD/info/AliTRDclusterInfo.cxx @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// TRD cluster summary info for performance // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// + #include "TMath.h" #include "AliLog.h" @@ -30,6 +39,7 @@ AliTRDclusterInfo::AliTRDclusterInfo() ,fD(0.) ,fTilt(0.) { +// Constructor. Resets all fields. fCov[0] = 1.; fCov[1] = 0.; fCov[2] = 1.; fCovCl[0] = 1.; fCovCl[1] = 0.; @@ -39,6 +49,7 @@ AliTRDclusterInfo::AliTRDclusterInfo() //_________________________________________________ void AliTRDclusterInfo::SetCluster(const AliTRDcluster *c) { +// Load rec cluster data if(!c) return; fDet = c->GetDetector(); fCol = c->GetPadCol(); @@ -57,6 +68,7 @@ void AliTRDclusterInfo::SetCluster(const AliTRDcluster *c) //_________________________________________________ void AliTRDclusterInfo::Print(Option_t */*opt*/) const { +// Dump info printf("Det[%3d] Col[%3d] Row[%2d] X[%7.2f] Y[%7.2f] Z[%7.2f] Q[%7.2f]\n", (fDet==0xffff ? -1 : fDet), (fCol==0xff ? -1 : fCol), (fRow==0xff ? -1 : fRow), fX, fY, fZ, fQ); printf("\tPdg[%d] Lbl[%d] Yt[%7.2f] Zt[%7.2f]\n", fPdg, fLbl, fYt, fZt); } diff --git a/PWG1/TRD/info/AliTRDclusterInfo.h b/PWG1/TRD/info/AliTRDclusterInfo.h index 19132539d3d..22ae7df8cef 100644 --- a/PWG1/TRD/info/AliTRDclusterInfo.h +++ b/PWG1/TRD/info/AliTRDclusterInfo.h @@ -3,6 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////////////////////////// +// // +// TRD cluster summary info for performance // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// #ifndef Root_TObject @@ -17,14 +25,9 @@ public: Float_t GetAnisochronity() const {return fD;} inline void GetCluster(Int_t &det, Float_t &x, Float_t &y, Float_t &z, Float_t &q, Int_t &t, Float_t *cov=0x0) const; - void GetMC(Int_t &pdg, Int_t &label) const{ - pdg = fPdg; - label= fLbl; } + void GetMC(Int_t &pdg, Int_t &label) const {pdg = fPdg; label= fLbl; } void GetGlobalPosition(Float_t &yt, Float_t &zt, Float_t &dydx, Float_t &dzdx, Float_t *cov=0x0) const { - dydx = fdydx; - dzdx = fdzdx; - yt = fYt; - zt = fZt; + dydx = fdydx; dzdx = fdzdx; yt = fYt; zt = fZt; if(cov) memcpy(cov, fCov, 3*sizeof(Float_t));} void GetCenterPad(Int_t &c, Int_t &r) const {c=fCol; r=fRow;} Float_t GetResolution() const {return fdy;} @@ -40,10 +43,7 @@ public: fPdg = pdg; fLbl = label;} void SetGlobalPosition(Float_t yt, Float_t zt, Float_t dydx, Float_t dzdx, Float_t *cov=0x0) { - fdydx = dydx; - fdzdx = dzdx; - fYt = yt; - fZt = zt; + fdydx = dydx; fdzdx = dzdx; fYt = yt; fZt = zt; if(cov) memcpy(fCov, cov, 3*sizeof(Float_t));} void SetResolution(Float_t dy) {fdy = dy;} void SetDriftLength(Float_t d) {fXd = d;} diff --git a/PWG1/TRD/info/AliTRDeventInfo.cxx b/PWG1/TRD/info/AliTRDeventInfo.cxx index f6cda69d9c1..0fe32a3971e 100644 --- a/PWG1/TRD/info/AliTRDeventInfo.cxx +++ b/PWG1/TRD/info/AliTRDeventInfo.cxx @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// Event info for TRD performance train // +// // +// Authors: // +// Markus Fasel // +// // +//////////////////////////////////////////////////////////////////////////// + #include "AliESDHeader.h" #include "AliESDRun.h" @@ -71,9 +80,11 @@ void AliTRDeventInfo::Delete(const Option_t *){ fRun = 0x0; } -void AliTRDeventInfo::SetOwner(){ - SetBit(kOwner, 1); +void AliTRDeventInfo::SetOwner() +{ // Do deep copy + + SetBit(kOwner, 1); fHeader = new AliESDHeader(*fHeader); fRun = new AliESDRun(*fRun); } diff --git a/PWG1/TRD/info/AliTRDeventInfo.h b/PWG1/TRD/info/AliTRDeventInfo.h index ced9c6578a6..96dd47c0c4c 100644 --- a/PWG1/TRD/info/AliTRDeventInfo.h +++ b/PWG1/TRD/info/AliTRDeventInfo.h @@ -1,5 +1,16 @@ -#ifndef __ALITRDEVENTINFO_H__ -#define __ALITRDEVENTINFO_H__ +#ifndef ALITRDEVENTINFO_H +#define ALITRDEVENTINFO_H + +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////////////////////////// +// // +// Event info for TRD performance train // +// // +// Authors: // +// Markus Fasel // +// // +//////////////////////////////////////////////////////////////////////////// #include @@ -27,7 +38,7 @@ private: kOwner = BIT(14) }; AliESDHeader *fHeader; //! The ESD Header - AliESDRun *fRun; //! The ESD Run Info + AliESDRun *fRun; //! The ESD Run Info ClassDef(AliTRDeventInfo, 1) }; diff --git a/PWG1/TRD/info/AliTRDpidInfo.cxx b/PWG1/TRD/info/AliTRDpidInfo.cxx index 3979c29f6cf..07fed448ae9 100644 --- a/PWG1/TRD/info/AliTRDpidInfo.cxx +++ b/PWG1/TRD/info/AliTRDpidInfo.cxx @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// TRD PID/Track summary info for performance // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// + #include "AliTRDpidInfo.h" #include "AliTRDgeometry.h" @@ -44,6 +53,7 @@ AliTRDpidInfo::~AliTRDpidInfo() //________________________________________________________________________ AliTRDpidInfo::AliTRDpidData const* AliTRDpidInfo::GetDataInLayer(Int_t ily) const { +// Extract PID raw signals for layer "ily" if(!fData) return NULL; if(ily<0 || ily>=AliTRDgeometry::kNlayer) return NULL; diff --git a/PWG1/TRD/info/AliTRDpidInfo.h b/PWG1/TRD/info/AliTRDpidInfo.h index 9b55d27a83a..c7dda030edf 100644 --- a/PWG1/TRD/info/AliTRDpidInfo.h +++ b/PWG1/TRD/info/AliTRDpidInfo.h @@ -3,6 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////////////////////////// +// // +// TRD PID/Track summary info for performance // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject #include "TObject.h" @@ -12,12 +20,15 @@ class AliTRDpidInfo : public TObject { public: class AliTRDpidData { + friend class AliTRDpidInfo; // allow direct access + friend class AliTRDpidRefMakerLQ; // allow direct access + friend class AliTRDpidRefMakerNN; // allow direct access public: AliTRDpidData(); virtual ~AliTRDpidData(){} Int_t Layer() const { return (fPLbin&0xf0)>>4;} Int_t Momentum() const { return fPLbin&0xf;} - + protected: UChar_t fPLbin; // momentum / layer bin Float_t fdEdx[8]; // dEdx array ClassDef(AliTRDpidData, 1) // PID layer representation diff --git a/PWG1/TRD/info/AliTRDtrackInfo.cxx b/PWG1/TRD/info/AliTRDtrackInfo.cxx index c543492562a..3d36c33584e 100644 --- a/PWG1/TRD/info/AliTRDtrackInfo.cxx +++ b/PWG1/TRD/info/AliTRDtrackInfo.cxx @@ -108,6 +108,8 @@ AliTRDtrackInfo::AliMCinfo::AliMCinfo(const AliMCinfo &mc) //________________________________________________________ Int_t AliTRDtrackInfo::AliMCinfo::GetPID() const { +// Translate pdg code to PID index + switch(fPDG){ case kElectron: case kPositron: return AliPID::kElectron; @@ -355,7 +357,7 @@ AliTrackReference* AliTRDtrackInfo::GetTrackRef(Int_t idx) const } //___________________________________________________ -AliTrackReference* AliTRDtrackInfo::GetTrackRef(AliTRDseedV1* const tracklet) const +AliTrackReference* AliTRDtrackInfo::GetTrackRef(const AliTRDseedV1* const tracklet) const { // // Returns a track reference @@ -462,7 +464,8 @@ Bool_t AliTRDtrackInfo::AliMCinfo::GetDirections(Float_t &x0, Float_t &y0, Float else SETBIT(status, 1); return kFALSE; } - if((pt=tr[1]->Pt()) < 1.e-3) return kFALSE; + pt=tr[1]->Pt(); + if(pt < 1.e-3) return kFALSE; Double_t dx = tr[1]->LocalX() - tr[0]->LocalX(); if(dx <= 0.){ diff --git a/PWG1/TRD/info/AliTRDtrackInfo.h b/PWG1/TRD/info/AliTRDtrackInfo.h index 4ee448621bf..508fd5a1fdc 100644 --- a/PWG1/TRD/info/AliTRDtrackInfo.h +++ b/PWG1/TRD/info/AliTRDtrackInfo.h @@ -116,7 +116,7 @@ public: ULong_t GetStatus() const {return fESD.fStatus;} AliTRDtrackV1* GetTrack() const { return fTRDtrack; } AliTrackReference* GetTrackRef(Int_t entry) const; - AliTrackReference* GetTrackRef(AliTRDseedV1* const tracklet) const; + AliTrackReference* GetTrackRef(const AliTRDseedV1* const tracklet) const; Bool_t IsCurved() const {return TestBit(kCurv);} Bool_t IsPrimary() const {return TestBit(kPrim);} diff --git a/PWG1/TRD/info/AliTRDtrendValue.cxx b/PWG1/TRD/info/AliTRDtrendValue.cxx index d61c02572d9..72954f1168e 100644 --- a/PWG1/TRD/info/AliTRDtrendValue.cxx +++ b/PWG1/TRD/info/AliTRDtrendValue.cxx @@ -1,3 +1,12 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// Trend Value Incapsulation // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// + #include "TString.h" #include "TObjString.h" #include "TObjArray.h" @@ -16,6 +25,7 @@ AliTRDtrendValue::AliTRDtrendValue() ,fResponsible() ,fNnotifiable(0) { +// Constructor. Reset all fields. memset(fLimits, 0, 2*(kNlevels+1)*sizeof(Double_t)); for(Int_t ilevel(kNlevels); ilevel--; ) sprintf(fAlarmMessage[ilevel], " "); } @@ -28,6 +38,7 @@ AliTRDtrendValue::AliTRDtrendValue(Char_t *n, Char_t *t) ,fResponsible() ,fNnotifiable(0) { +// Constructor. Define name and title for trend variable. TString s(n); TObjArray *names(s.Tokenize("_")); if(names->GetEntriesFast()!=2){ @@ -56,6 +67,7 @@ Int_t AliTRDtrendValue::GetAlarmLevel() //____________________________________________ const char* AliTRDtrendValue::GetAlarmMessage() const { +// Check if value triggered alarm if(!fAlarmLevel) return "OK"; else return fAlarmMessage[fAlarmLevel-1]; } @@ -63,6 +75,7 @@ const char* AliTRDtrendValue::GetAlarmMessage() const //____________________________________________ const char* AliTRDtrendValue::GetClassName() const { +// Check task to which value belong TString s(TNamed::GetName()); TObjArray *names(s.Tokenize("_")); if(names->GetEntriesFast()!=2){ @@ -76,6 +89,7 @@ const char* AliTRDtrendValue::GetClassName() const //____________________________________________ const char* AliTRDtrendValue::GetValueName() const { +// value name TString s(TNamed::GetName()); TObjArray *names(s.Tokenize("_")); if(names->GetEntriesFast()!=2){ @@ -88,37 +102,41 @@ const char* AliTRDtrendValue::GetValueName() const //____________________________________________ const char* AliTRDtrendValue::GetResponsible(Char_t *n, Char_t *mail) const { - if(n) sprintf(n, "%s", fResponsible.name); - if(mail) sprintf(mail, "%s", fResponsible.mail); - return Form("%s <%s>", fResponsible.name, fResponsible.mail); +// Get responsible with name and mail + if(n) sprintf(n, "%s", fResponsible.fNameR); + if(mail) sprintf(mail, "%s", fResponsible.fMail); + return Form("%s <%s>", fResponsible.fNameR, fResponsible.fMail); } //____________________________________________ const char* AliTRDtrendValue::GetNotifiable(Int_t in, Char_t *n, Char_t *mail) const { +// Get noticible person "in" with name and mail if(in<0||in>=fNnotifiable) return NULL; - if(n) sprintf(n, "%s", fNotifiable[in].name); - if(mail) sprintf(mail, "%s", fNotifiable[in].mail); - return Form("%s <%s>", fNotifiable[in].name, fNotifiable[in].mail); + if(n) sprintf(n, "%s", fNotifiable[in].fNameR); + if(mail) sprintf(mail, "%s", fNotifiable[in].fMail); + return Form("%s <%s>", fNotifiable[in].fNameR, fNotifiable[in].fMail); } //____________________________________________ void AliTRDtrendValue::SetNotifiable(const Char_t *name, const Char_t *mail) { +// add noticible person to DB if(fNnotifiable==kNnotifiable){ AliWarning(Form("Could not add %s for notification. Only %d persons can be registered for notification.", name, kNnotifiable)); return; } - sprintf(fNotifiable[fNnotifiable].name, "%s", name); - sprintf(fNotifiable[fNnotifiable].mail, "%s", mail); + sprintf(fNotifiable[fNnotifiable].fNameR, "%s", name); + sprintf(fNotifiable[fNnotifiable].fMail, "%s", mail); fNnotifiable++; } //____________________________________________ void AliTRDtrendValue::SetResponsible(const Char_t *name, const Char_t *mail) { - sprintf(fResponsible.name, "%s", name); - sprintf(fResponsible.mail, "%s", mail); +// set responsible person for trend + sprintf(fResponsible.fNameR, "%s", name); + sprintf(fResponsible.fMail, "%s", mail); } //____________________________________________ @@ -135,17 +153,18 @@ void AliTRDtrendValue::Print(Option_t */*o*/) const printf("*** Alarm level : %d limits[%f %f]\n", fAlarmLevel, fLimits[2*fAlarmLevel], fLimits[2*fAlarmLevel+1]); printf("*** Alarm message : %s\n", GetAlarmMessage()); } - printf("*** Responsible %s <%s>\n", fResponsible.name, fResponsible.mail); + printf("*** Responsible %s <%s>\n", fResponsible.fNameR, fResponsible.fMail); if(fNnotifiable){ printf("*** Notifiable person(s) ***\n"); for(Int_t i(0); i\n", fNotifiable[i].name, fNotifiable[i].mail); + printf(" %s <%s>\n", fNotifiable[i].fNameR, fNotifiable[i].fMail); } } //____________________________________________ AliTRDtrendValue::AliTRDtrendValueResponsible::AliTRDtrendValueResponsible(Char_t *n, Char_t *m) { - if(n) sprintf(name, "%s", n); else sprintf(name, " "); - if(m) sprintf(mail, "%s", m); else sprintf(mail, " "); +// define person with mail and mail + if(n) sprintf(fNameR, "%s", n); else sprintf(fNameR, " "); + if(m) sprintf(fMail, "%s", m); else sprintf(fMail, " "); } diff --git a/PWG1/TRD/info/AliTRDtrendValue.h b/PWG1/TRD/info/AliTRDtrendValue.h index 72d5be4d9f9..cfacd2c6f29 100644 --- a/PWG1/TRD/info/AliTRDtrendValue.h +++ b/PWG1/TRD/info/AliTRDtrendValue.h @@ -3,6 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////////////////////////// +// // +// Trend Value Incapsulation // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TNamed #include "TNamed.h" @@ -10,9 +18,8 @@ class AliTRDtrendValue : public TNamed { -public: - friend class AliTRDtrendingManager; - +friend class AliTRDtrendingManager; // allow easy access for Manager +public: enum ETRDtrendValue{ kNlevels = 4 ,kNnotifiable = 10 @@ -38,19 +45,22 @@ protected: // only manager can fill these info !! void SetNotifiable(const Char_t *name, const Char_t *mail); private: + AliTRDtrendValue(const AliTRDtrendValue &ref); + const AliTRDtrendValue& operator=(const AliTRDtrendValue &ref); + UChar_t fAlarmLevel;// alarm level Double_t fValue; // current value Double_t fLimits[2*(kNlevels+1)];// limits - Char_t fAlarmMessage[kNlevels][1024]; // + Char_t fAlarmMessage[kNlevels][1024]; // list of alarm messages struct AliTRDtrendValueResponsible{ AliTRDtrendValueResponsible(Char_t *name=NULL, Char_t *mail=NULL); - Char_t name[100]; - Char_t mail[200]; + Char_t fNameR[100]; // name of responsible + Char_t fMail[200]; // mail of responsible }; AliTRDtrendValueResponsible fResponsible; // responsible person Int_t fNnotifiable; // number of persons to be notify - AliTRDtrendValueResponsible fNotifiable[kNnotifiable]; // + AliTRDtrendValueResponsible fNotifiable[kNnotifiable]; //also notify these persons ClassDef(AliTRDtrendValue, 0) // TRD trending value representation }; diff --git a/PWG1/TRD/info/AliTRDtrendingManager.cxx b/PWG1/TRD/info/AliTRDtrendingManager.cxx index 8a6826a736c..8345cb09630 100644 --- a/PWG1/TRD/info/AliTRDtrendingManager.cxx +++ b/PWG1/TRD/info/AliTRDtrendingManager.cxx @@ -1,3 +1,13 @@ +//////////////////////////////////////////////////////////////////////////// +// // +// Trend Value Manager // +// // +// Mediates interaction with DB (OCDB ?!) // // // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// + #include "TObjArray.h" #include "AliLog.h" #include "AliCDBRunRange.h" @@ -61,12 +71,14 @@ AliTRDtrendingManager::AliTRDtrendingManager() ,fEntries(NULL) ,fValue(NULL) { +// Constructor fRunRange[0] = 0; fRunRange[1] = AliCDBRunRange::Infinity(); } //____________________________________________ AliTRDtrendingManager::~AliTRDtrendingManager() { +// Destructor if(fValue) delete fValue; if(fEntries) delete fEntries; } @@ -78,8 +90,8 @@ void AliTRDtrendingManager::AddValue( ,Char_t *title ,Double_t limits[2*(AliTRDtrendValue::kNlevels+1)] ,Char_t *messages[AliTRDtrendValue::kNlevels] - ,Char_t *responsible - ,Char_t *notifiables + ,const Char_t *responsible + ,const Char_t *notifiables ) { // Expert Function !!! @@ -138,6 +150,7 @@ void AliTRDtrendingManager::AddValue( //____________________________________________ AliTRDtrendValue* AliTRDtrendingManager::GetValue(Char_t *class_name, Char_t *value_name) { +// Search trend value list by value "value_name" and class responsible "class_name" if(!fEntries){ AliError("No trending map defined."); return NULL; @@ -157,8 +170,8 @@ Bool_t AliTRDtrendingManager::ModifyValue( ,Char_t *title ,Double_t *limits ,Char_t **messages - ,Char_t *responsible - ,Char_t *notifiables + ,const Char_t *responsible + ,const Char_t *notifiables ) { // Expert Function !!! @@ -212,6 +225,7 @@ Bool_t AliTRDtrendingManager::ModifyValue( //____________________________________________ void AliTRDtrendingManager::Print(Option_t *o) const { +// Dump trend value list if(!fEntries){ AliError("No trending map available."); return; diff --git a/PWG1/TRD/info/AliTRDtrendingManager.h b/PWG1/TRD/info/AliTRDtrendingManager.h index e47f2ce0b6b..b0fad5924d0 100644 --- a/PWG1/TRD/info/AliTRDtrendingManager.h +++ b/PWG1/TRD/info/AliTRDtrendingManager.h @@ -3,6 +3,14 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ +//////////////////////////////////////////////////////////////////////////// +// // +// Trend Value Manager // +// // +// Authors: // +// Alexandru Bercuci // +// // +//////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject #include "TObject.h" @@ -22,8 +30,8 @@ public: ,Char_t *value_title ,Double_t limits[2*(AliTRDtrendValue::kNlevels+1)] ,Char_t *messages[AliTRDtrendValue::kNlevels] - ,Char_t *responsible - ,Char_t *notifiables=NULL + ,const Char_t *responsible + ,const Char_t *notifiables=NULL ); AliTRDtrendValue* GetValue(Char_t *class_name, Char_t *value_name); static AliTRDtrendingManager* Instance(); @@ -32,8 +40,8 @@ public: ,Char_t *value_title ,Double_t *limits=NULL ,Char_t **messages=NULL - ,Char_t *responsible=NULL - ,Char_t *notifiables=NULL + ,const Char_t *responsible=NULL + ,const Char_t *notifiables=NULL ); void Print(Option_t *o="") const; void Save(); -- 2.43.5