]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
move OCDB manipulation from local train (run.C) to the task level
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Aug 2010 08:00:30 +0000 (08:00 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Aug 2010 08:00:30 +0000 (08:00 +0000)
1. task infoGen manages OCDB init (steer via AddTRDinfoGen.C)
2. task resolution manages Geometry/Align loading from OCDB
3. task clusterResolution manages B filed init

the task check PID which depends on OCDB access works now also under PilotAnalysis.C macro.

PWG1/TRD/AliTRDclusterResolution.cxx
PWG1/TRD/AliTRDclusterResolution.h
PWG1/TRD/AliTRDinfoGen.cxx
PWG1/TRD/AliTRDinfoGen.h
PWG1/TRD/AliTRDresolution.cxx
PWG1/TRD/AliTRDresolution.h
PWG1/TRD/info/AliTRDclusterInfo.cxx
PWG1/TRD/info/AliTRDclusterInfo.h
PWG1/TRD/macros/AddTRDinfoGen.C
PWG1/TRD/macros/AddTRDresolution.C
PWG1/TRD/run.C

index 63e67b4de977f385c7019a3d65706f9225c3e4c0..d4fe1de26a750e2b972c3f0c2a6374623939d1cb 100644 (file)
 #include "AliTRDclusterResolution.h"
 #include "info/AliTRDclusterInfo.h"
 #include "AliTRDgeometry.h"
+#include "AliTRDpadPlane.h"
 #include "AliTRDcluster.h"
 #include "AliTRDseedV1.h"
 #include "AliTRDcalibDB.h"
 #include "Cal/AliTRDCalDet.h"
 
 #include "AliLog.h"
-#include "AliTracker.h"
+#include "AliESDEvent.h"
 #include "AliCDBManager.h"
 
 #include "TROOT.h"
@@ -208,6 +209,8 @@ AliTRDclusterResolution::AliTRDclusterResolution()
   ,fResults(NULL)
   ,fStatus(0)
   ,fDet(-1)
+  ,fCol(-1)
+  ,fRow(-1)
   ,fExB(0.)
   ,fVdrift(0.)
   ,fT0(0.)
@@ -229,6 +232,8 @@ AliTRDclusterResolution::AliTRDclusterResolution(const char *name)
   ,fResults(NULL)
   ,fStatus(0)
   ,fDet(-1)
+  ,fCol(-1)
+  ,fRow(-1)
   ,fExB(0.)
   ,fVdrift(0.)
   ,fT0(0.)
@@ -492,7 +497,13 @@ void AliTRDclusterResolution::UserExec(Option_t *)
 // Fill container histograms
 
   fInfo = dynamic_cast<TObjArray *>(GetInputData(1));
-  if(!HasExB()) AliWarning("ExB was not set. Call SetExB() before running the task.");
+  if(!HasExB()){ 
+    SetExB();
+    if(!HasExB()){ 
+      AliWarning("Magnetic field settings failed. Check OCDB access.");
+      return;
+    }
+  }
 
   Int_t det, t;
   Float_t x, y, z, q, dy, dydx, dzdx, cov[3], covcl[3];
@@ -509,10 +520,18 @@ void AliTRDclusterResolution::UserExec(Option_t *)
   TIterator *iter=fInfo->MakeIterator();
   while((cli=dynamic_cast<AliTRDclusterInfo*>((*iter)()))){
     cli->GetCluster(det, x, y, z, q, t, covcl);
-    dy = cli->GetResolution();
-    AliDebug(4, Form("det[%d] tb[%2d] q[%4.0f Log[%6.4f]] dy[%7.2f][um] ypull[%5.2f]", det, t, q, TMath::Log(q), 1.e4*dy, dy/TMath::Sqrt(covcl[0])));
 
+    // select cluster according to detector region if specified
     if(fDet>=0 && fDet!=det) continue;
+    if(fCol>=0 && fRow>=0){
+      Int_t c,r;
+      cli->GetCenterPad(c, r);
+      if(TMath::Abs(fCol-c) > 5) continue;
+      if(TMath::Abs(fRow-r) > 2) continue;
+    }
+
+    dy = cli->GetResolution();
+    AliDebug(4, Form("det[%d] tb[%2d] q[%4.0f Log[%6.4f]] dy[%7.2f][um] ypull[%5.2f]", det, t, q, TMath::Log(q), 1.e4*dy, dy/TMath::Sqrt(covcl[0])));
     
     cli->GetGlobalPosition(y, z, dydx, dzdx, &cov[0]);
 
@@ -629,34 +648,50 @@ Bool_t AliTRDclusterResolution::PostProcess()
 }
 
 //_______________________________________________________
-Bool_t AliTRDclusterResolution::SetExB(Int_t det, Int_t col, Int_t row)
+Bool_t AliTRDclusterResolution::SetExB()
 {
-  // check OCDB
-  AliCDBManager *cdb = AliCDBManager::Instance();
+// Retrieve calibration parameters from OCDB, drift velocity and t0 for the detector region specified by
+// a previous call to AliTRDclusterResolution::SetCalibrationRegion().
+
+  AliCDBManager *cdb = AliCDBManager::Instance(); // init OCDB
   if(cdb->GetRun() < 0){
     AliError("OCDB manager not properly initialized");
     return kFALSE;
   }
 
   // check magnetic field
-  if(TMath::Abs(AliTracker::GetBz()) < 1.e-10){
-    AliWarning("B=0. Magnetic field may not be initialized. Continue if you know what you are doing !");
+  AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
+  if(!esd){
+    AliError("Failed retrieving ESD event");
+    return kFALSE;
+  }
+  if(esd->InitMagneticField()){
+    AliError("Magnetic field failed initialization.");
+    return kFALSE;
   }
 
-  // set reference detector if any
-  fDet = -1;
-  if(det>=0 && det<AliTRDgeometry::kNdet) fDet = det;
-  else det=0;
+  // check pad for detector
+  if(fCol>=0 && fRow>=0){
+    AliTRDgeometry geo;
+    AliTRDpadPlane *pp(geo.GetPadPlane(fDet));
+    if(fCol>=pp->GetNcols() ||
+       fRow>=pp->GetNrows()){
+      AliWarning(Form("Pad coordinates col[%d] or row[%d] incorrect for det[%d].\nLimits are max col[%d] max row[%d]. Reset to default", fCol, fRow, fDet, pp->GetNcols(), pp->GetNrows()));
+      fCol = -1; fRow=-1;
+    }
+  }
 
   AliTRDcalibDB *fCalibration  = AliTRDcalibDB::Instance();
-  AliTRDCalROC  *fCalVdriftROC(fCalibration->GetVdriftROC(det))
-               ,*fCalT0ROC(fCalibration->GetT0ROC(det));
+  AliTRDCalROC  *fCalVdriftROC(fCalibration->GetVdriftROC(fDet>=0?fDet:0))
+               ,*fCalT0ROC(fCalibration->GetT0ROC(fDet>=0?fDet:0));
   const AliTRDCalDet  *fCalVdriftDet = fCalibration->GetVdriftDet();
   const AliTRDCalDet  *fCalT0Det = fCalibration->GetT0Det();
 
-  fVdrift = fCalVdriftDet->GetValue(det) * fCalVdriftROC->GetValue(col, row);
+  fVdrift = fCalVdriftDet->GetValue(fDet>=0?fDet:0);
+  if(fCol>=0 && fRow>=0) fVdrift*= fCalVdriftROC->GetValue(fCol, fRow);
   fExB    = AliTRDCommonParam::Instance()->GetOmegaTau(fVdrift);
-  fT0     = fCalT0Det->GetValue(det) * fCalT0ROC->GetValue(col, row);
+  fT0     = fCalT0Det->GetValue(fDet>=0?fDet:0);
+  if(fCol>=0 && fRow>=0) fT0 *= fCalT0ROC->GetValue(fCol, fRow);
   SetBit(kExB);
 
   AliDebug(1, Form("Calibrate for Det[%3d] t0[%5.3f] vd[%5.3f] ExB[%f]", fDet, fT0, fVdrift, fExB));
@@ -664,6 +699,23 @@ Bool_t AliTRDclusterResolution::SetExB(Int_t det, Int_t col, Int_t row)
   return kTRUE;
 }
 
+//_______________________________________________________
+void AliTRDclusterResolution::SetCalibrationRegion(Int_t det, Int_t col, Int_t row)
+{
+// Set calibration region in terms of detector and pad. 
+// By default detector 0 mean values are considered.
+
+  if(det>=0 && det<AliTRDgeometry::kNdet){ 
+    fDet = det;
+    if(col>=0 && row>=0){
+      fCol = col;
+      fRow = row;
+    }
+    return;
+  }
+  AliError(Form("Detector index outside range [0 %d].", AliTRDgeometry::kNdet));
+}
+
 //_______________________________________________________
 void AliTRDclusterResolution::SetVisual()
 {
index 36a0e816426ca6a8dd031b07fb2df340c444364c..370ab484ae320093095a8ac669297676f726ef11 100644 (file)
@@ -38,8 +38,10 @@ public:
   void          UserCreateOutputObjects();
   void          UserExec(Option_t *);
   Int_t         GetDetector() const { return fDet; }
+  void          GetPad(Int_t &c, Int_t &r) const { c=fCol, r=fRow; return;}
   inline Float_t GetExB() const;
   inline Float_t GetVdrift() const;
+  inline Float_t GetT0() const;
   Bool_t        GetRefFigure(Int_t ifig);
   Bool_t        HasProcess(EResultContainer bit) const {return TESTBIT(fStatus, bit);}
   Bool_t        HasExB() const { return TestBit(kExB);}
@@ -51,7 +53,7 @@ public:
   Bool_t        IsSaveAs() const {return TestBit(kSaveAs);}
 
   Bool_t        PostProcess();
-  Bool_t        SetExB(Int_t det=-1, Int_t c = 70, Int_t r = 7);
+  void          SetCalibrationRegion(Int_t det, Int_t col=-1, Int_t row=-1);
   void          SetVisual();
   void          SetProcess(EResultContainer bit, Bool_t v = kTRUE) {v ? SETBIT(fStatus, bit) : CLRBIT(fStatus, bit);}
   void          SetSaveAs(Bool_t v = kTRUE) {SetBit(kSaveAs, v);}
@@ -66,12 +68,15 @@ protected:
 private:
   AliTRDclusterResolution(const AliTRDclusterResolution&);  
   AliTRDclusterResolution& operator=(const AliTRDclusterResolution&);
+  Bool_t        SetExB();
 
   TCanvas    *fCanvas; //! visualization canvas 
   TObjArray  *fInfo;   //! list of cluster info
   TObjArray  *fResults;// list of result graphs/histos/trees
   UChar_t    fStatus;  // steer parameter of the task
   Short_t    fDet;     // detector (-1 for all)
+  Char_t     fCol;     // pad column (-1 for all)
+  Char_t     fRow;     // pad row (-1 for all)
   Float_t    fExB;     // tg of the Lorentz angle
   Float_t    fVdrift;  // mean drift velocity
   Float_t    fT0;      // time 0
@@ -107,6 +112,15 @@ inline Float_t AliTRDclusterResolution::GetVdrift() const
   return fVdrift;
 }
 
+//___________________________________________________
+inline Float_t AliTRDclusterResolution::GetT0() const
+{ 
+  if(!HasExB()){
+    printf("WARNING :: ExB was not set. Use B=0.\n");
+  }
+  return fT0;
+}
+
 //___________________________________________________
 inline void AliTRDclusterResolution::ResetProcesses()
 {
index d0c566c8d2245158e3effb8b4b259101222fac3c..5f5603e4d57ae10f2e1ddb243b7006966318cd73 100644 (file)
@@ -45,6 +45,7 @@
 
 #include "AliLog.h"
 #include "AliAnalysisManager.h"
+#include "AliCDBManager.h"
 #include "AliESDEvent.h"
 #include "AliMCEvent.h"
 #include "AliESDInputHandler.h"
 #include "AliMCParticle.h"
 #include "AliPID.h"
 #include "AliStack.h"
-#include "AliTRDtrackV1.h"
 #include "AliTrackReference.h"
-#include "AliTRDgeometry.h"
-#include "AliTRDcluster.h"
-#include "AliTRDseedV1.h"
 #include "TTreeStream.h"
 
 #include <cstdio>
 #include <cstring>
 #include <iostream>
 
+#include "AliTRDcalibDB.h"
+#include "AliTRDtrackerV1.h"
+#include "AliTRDgeometry.h"
+#include "AliTRDtrackV1.h"
+#include "AliTRDseedV1.h"
+#include "AliTRDcluster.h"
 #include "AliTRDinfoGen.h"
 #include "info/AliTRDtrackInfo.h"
 #include "info/AliTRDeventInfo.h"
@@ -102,6 +105,7 @@ AliTRDinfoGen::AliTRDinfoGen()
   ,fEventCut(NULL)
   ,fTrackCut(NULL)
   ,fV0Cut(NULL)
+  ,fOCDB("local://$ALICE_ROOT/OCDB")
   ,fTrackInfo(NULL)
   ,fEventInfo(NULL)
   ,fV0Info(NULL)
@@ -127,6 +131,7 @@ AliTRDinfoGen::AliTRDinfoGen(char* name)
   ,fEventCut(NULL)
   ,fTrackCut(NULL)
   ,fV0Cut(NULL)
+  ,fOCDB("local://$ALICE_ROOT/OCDB")
   ,fTrackInfo(NULL)
   ,fEventInfo(NULL)
   ,fV0Info(NULL)
@@ -265,12 +270,22 @@ void AliTRDinfoGen::UserExec(Option_t *){
   //
 
   fESDev = dynamic_cast<AliESDEvent*>(InputEvent());
-  fMCev = MCEvent();
-
   if(!fESDev){
     AliError("Failed retrieving ESD event");
     return;
   }
+  if(!IsInitOCDB()){
+    // prepare OCDB access
+    AliCDBManager* ocdb = AliCDBManager::Instance();
+    ocdb->SetDefaultStorage(fOCDB.Data());
+    ocdb->SetRun(fESDev->GetRunNumber());
+    AliTRDtrackerV1::SetNTimeBins(AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS());
+    AliInfo(Form("OCDB :  Loc[%s] Run[%d] TB[%d]", fOCDB.Data(), ocdb->GetRun(), AliTRDtrackerV1::GetNTimeBins()));
+    SetInitOCDB();
+  }
+
+  // link MC if available
+  fMCev = MCEvent();
 
   // event selection : trigger cut
   if(UseLocalEvSelection() && fEvTrigger){ 
index ebd9e8949b0e167533715e4c6930805d76056051..2550bdb8aa8a97b1b85d462c02d91fe45a0657af 100644 (file)
@@ -34,6 +34,7 @@ public:
    ,kUseLocalEvSelection  = BIT(19)
    ,kUseLocalTrkSelection = BIT(20)
    ,kCollision            = BIT(21)
+   ,kOCDB                 = BIT(22)
   };
 
   AliTRDinfoGen();
@@ -45,20 +46,23 @@ public:
   static Float_t GetEndTPC() { return fgkTPC;}
   static Float_t GetEndTRD() { return fgkTRD;}
   Int_t   GetNRefFigures() const  { return 1;} 
+  const char* GetOCDB() const {return fOCDB.Data();}
   Bool_t  GetRefFigure(Int_t ifig);
   Bool_t  Load(const Char_t *fn="AnalysisResults.root", const Char_t *dir="TRD_Performance", const Char_t *name=NULL);
 
   Bool_t  HasMCdata() const       { return TestBit(kMCdata);};
   // temporary until check with AliAnalysisTaskSE collision selection mechanism
+  Bool_t  IsInitOCDB() const {return TestBit(kOCDB);}
   Bool_t  IsCollision() const {return TestBit(kCollision);}
+  void    SetInitOCDB(Bool_t set=kTRUE) {SetBit(kOCDB, set);}
   void    SetCollision(Bool_t set=kTRUE) {SetBit(kCollision, set);}
-
   void    SetLocalEvSelection(AliTRDeventCuts */*cut*/){;} 
   void    SetLocalEvSelection(Bool_t use=kTRUE) {SetBit(kUseLocalEvSelection, use);}
   void    SetLocalTrkSelection(AliESDtrackCuts */*cut*/){;} 
   void    SetLocalTrkSelection(Bool_t use=kTRUE) {SetBit(kUseLocalTrkSelection, use);}
   void    SetLocalV0Selection(AliTRDv0Info *v0);
   void    SetMCdata(Bool_t mc = kTRUE) {SetBit(kMCdata, mc);}
+  void    SetOCDB(const char *ocdb) {fOCDB=ocdb;}
   void    SetTrigger(const Char_t *trigger);
 
   Bool_t  UseLocalEvSelection() const {return TestBit(kUseLocalEvSelection);}
@@ -94,6 +98,7 @@ private:
   AliTRDeventCuts  *fEventCut;       // event cut
   AliESDtrackCuts  *fTrackCut;       // track cut
   AliTRDv0Info     *fV0Cut;          // v0 cut
+  TString           fOCDB;           // OCDB location
   AliTRDtrackInfo  *fTrackInfo;      //! Track info
   AliTRDeventInfo  *fEventInfo;             //! Event info
   AliTRDv0Info     *fV0Info;         //! V0 info
index f36663b6fedc55ec7e8095a491a22260d9bd33db..5c00dc850fe3d1b7e5264da2ae19e2d33f776c92 100644 (file)
 #include "AliPID.h"
 #include "AliLog.h"
 #include "AliESDtrack.h"
+#include "AliCDBManager.h"
+#include "AliCDBPath.h"
+#include "AliCDBEntry.h"
+#include "AliGeomManager.h"
 #include "AliMathBase.h"
 
 #include "AliTRDresolution.h"
@@ -117,7 +121,6 @@ Char_t const *AliTRDresolution::fgkResYsegmName[3] = {
 //________________________________________________________
 AliTRDresolution::AliTRDresolution()
   :AliTRDrecoTask()
-  ,fStatus(0)
   ,fSegmentLevel(0)
   ,fIdxPlot(0)
   ,fIdxFrame(0)
@@ -142,7 +145,6 @@ AliTRDresolution::AliTRDresolution()
 //________________________________________________________
 AliTRDresolution::AliTRDresolution(char* name)
   :AliTRDrecoTask(name, "TRD spatial and momentum resolution")
-  ,fStatus(0)
   ,fSegmentLevel(0)
   ,fIdxPlot(0)
   ,fIdxFrame(0)
@@ -202,7 +204,6 @@ void AliTRDresolution::UserCreateOutputObjects()
     fReconstructor = new AliTRDReconstructor();
     fReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam());
   }
-  if(!fGeo) fGeo = new AliTRDgeometry();
 
   AliTRDrecoTask::UserCreateOutputObjects();
   PostData(kClToTrk, fCl);
@@ -232,6 +233,17 @@ void AliTRDresolution::UserExec(Option_t *opt)
   // Execution part
   //
 
+  if(!IsInitGeom()){
+    // create geometry
+    AliCDBManager* ocdb = AliCDBManager::Instance();
+    AliCDBEntry* obj = ocdb->Get(AliCDBPath("GRP", "Geometry", "Data"));
+    AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
+    AliGeomManager::GetNalignable("TRD");
+    AliGeomManager::ApplyAlignObjsFromCDB("TRD"); 
+    fGeo = new AliTRDgeometry();
+    SetInitGeom();
+  }
+
   fCl->Delete();
   fMCcl->Delete();
 /*  fTrklt->Delete();
index 736d0d95756d4d9a47216af839dfef1523b8e36e..4fb0b61590515ffcfed62e720781890768c52fa2 100644 (file)
@@ -48,8 +48,9 @@ public:
     ,kNprojs     = 70 // total number of projections for all views
   };
   enum ETRDresolutionSteer {
-    kVerbose  = 0
-    ,kVisual  = 1
+    kVerbose  = BIT(18)
+    ,kVisual  = BIT(19)
+    ,kGeom    = BIT(20)
   };
   enum ETRDresolutionOutSlots {
      kClToTrk    = 2
@@ -74,8 +75,9 @@ public:
   TObjArray*  Results(Int_t i=0) const {return i ? fGraphS : fGraphM;} 
   void    UserExec(Option_t * opt);
   void    InitExchangeContainers();
-  Bool_t  IsVerbose() const {return TESTBIT(fStatus, kVerbose);}
-  Bool_t  IsVisual() const {return TESTBIT(fStatus, kVisual);}
+  Bool_t  IsInitGeom() const {return TestBit(kGeom);}
+  Bool_t  IsVerbose() const {return TestBit(kVerbose);}
+  Bool_t  IsVisual() const {return TestBit(kVisual);}
   Bool_t  PostProcess();
 
   TH1*    PlotCharge(const AliTRDtrackV1 *t=NULL);
@@ -88,8 +90,9 @@ public:
   void    SetSegmentationLevel(Int_t l=0);
   void    SetPtThreshold(Float_t pt) {fPtThreshold = pt;}
   void    SetRecoParam(AliTRDrecoParam *r);
-  void    SetVerbose(Bool_t v = kTRUE) {v ? SETBIT(fStatus ,kVerbose): CLRBIT(fStatus ,kVerbose);}
-  void    SetVisual(Bool_t v = kTRUE) {v ? SETBIT(fStatus, kVisual) : CLRBIT(fStatus, kVisual);}
+  void    SetInitGeom(Bool_t set = kTRUE) {SetBit(kGeom, set);}
+  void    SetVerbose(Bool_t v = kTRUE) {SetBit(kVerbose, v);}
+  void    SetVisual(Bool_t v = kTRUE) {SetBit(kVisual, v);}
 
   void    Terminate(Option_t * opt);
   Bool_t  GetGraph(Float_t *bb, ETRDresolutionPlot ip, Int_t idx=-1, Bool_t kLEG=kTRUE, const Char_t *explain=NULL);
@@ -116,8 +119,7 @@ private:
   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);
 
-  UChar_t             fStatus;          // steer parameter of the task
-  UChar_t             fSegmentLevel;    // steer parameter of the task
+  UChar_t             fSegmentLevel;    // segmentation level [sector/stack/chamber]
   UShort_t            fIdxPlot;         // plot counter (internal)
   UShort_t            fIdxFrame;        // frame counter (internal)
   UShort_t            fNcomp[kNprojs];  // number of projections per task
index dbd8d2f2931125908deeafb8b33769ae3892f32c..da3de30fbfa33133f60186c995ae4b38e6dd6182 100644 (file)
@@ -11,6 +11,8 @@ ClassImp(AliTRDclusterInfo)
 AliTRDclusterInfo::AliTRDclusterInfo()
   : TObject()
   ,fDet(0xffff)
+  ,fCol(0xff)
+  ,fRow(0xff)
   ,fPdg(0)
   ,fLbl(-1)
   ,fLocalTime(-100)
@@ -39,6 +41,8 @@ void AliTRDclusterInfo::SetCluster(const AliTRDcluster *c)
 {
   if(!c) return;
   fDet = c->GetDetector();
+  fCol = c->GetPadCol();
+  fRow = c->GetPadRow();
   fX   = c->GetX();
   fY   = c->GetY();
   fZ   = c->GetZ();
@@ -53,6 +57,6 @@ void AliTRDclusterInfo::SetCluster(const AliTRDcluster *c)
 //_________________________________________________
 void AliTRDclusterInfo::Print(Option_t */*opt*/) const
 {
-  printf("Det[%3d] X[%7.2f] Y[%7.2f] Z[%7.2f] Q[%7.2f]\n", fDet==0xffff ? -1 : fDet, fX, fY, fZ, fQ);
+  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);
 }
index b946fa38e88ba264a59136da29863f8dbe527020..19132539d3d2ed7b05710347818dc2d94acee3ef 100644 (file)
@@ -26,6 +26,7 @@ public:
       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;}
   Float_t   GetDriftLength() const {return fXd;}
   Float_t   GetYDisplacement() const {return fYd;}
@@ -50,6 +51,8 @@ public:
 
 private:
   UShort_t fDet;   // detector
+  UChar_t  fCol;   // central pad column
+  UChar_t  fRow;   // pad row
   Short_t  fPdg;   // particle code
   Short_t  fLbl;   // track label (MC)
   Short_t  fLocalTime; // calibrate drift time
@@ -69,7 +72,7 @@ private:
   Float_t  fD;     // distance to the anode wire
   Float_t  fTilt;  // pad tilt;
 
-  ClassDef(AliTRDclusterInfo, 1) // extracted cluster2MC information
+  ClassDef(AliTRDclusterInfo, 2) // extracted cluster2MC information
 };
 
 
index 0139510702f6b6666bebf1d5e59ab37de1e4fe60..82f845c5172837dde34ad57145b396e51908f250 100644 (file)
@@ -19,7 +19,7 @@ void AddTRDinfoGen(AliAnalysisManager *mgr, Char_t *trd, AliAnalysisDataContaine
   info->SetDebugLevel(0);
   info->SetMCdata(mc);
   info->SetLocalTrkSelection();
-
+  info->SetOCDB("alien://folder=/alice/data/2010/OCDB");
   // settings for collisions
   info->SetCollision(/*kFALSE*/);
   if(info->IsCollision()){
index ca49ce1a171741a84b0d6947512fad83b12844ec..95e5212ba40a2a5ca5a392f256bc22f104ea7505 100644 (file)
@@ -44,16 +44,16 @@ void AddTRDresolution(AliAnalysisManager *mgr, Char_t *trd, AliAnalysisDataConta
     if(TSTBIT(map, kClErrParam)){
       AliTRDclusterResolution *taskCl(NULL);
       AliLog::SetClassDebugLevel("AliTRDclusterResolution", 2);
-      for(Int_t idet(0); idet<AliTRDgeometry::kNdet; idet++){
+      for(Int_t idet(10); idet<11/*AliTRDgeometry::kNdet*/; idet++){
         mgr->AddTask(taskCl = new AliTRDclusterResolution(Form("ClErrCalib%03d", idet)));
-        taskCl->SetExB(idet);
+        taskCl->SetCalibrationRegion(idet);
         taskCl->SetDebugLevel(0);
         mgr->ConnectInput(taskCl,  0, mgr->GetCommonInputContainer());  
         mgr->ConnectInput(taskCl,  1, (AliAnalysisDataContainer*)coa->FindObject(Form("%sCl2Trk%s", res->GetName(), suffix[itq])));
         mgr->ConnectOutput(taskCl, 1, mgr->CreateContainer(taskCl->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD.CalibClErrParam", mgr->GetCommonFileName())));
         if(mgr->GetMCtruthEventHandler()){
           mgr->AddTask(taskCl = new AliTRDclusterResolution(Form("ClErrCalibMC%03d", idet)));
-          taskCl->SetExB(idet);
+          taskCl->SetCalibrationRegion(idet);
           taskCl->SetDebugLevel(0);
           mgr->ConnectInput(taskCl,  0, mgr->GetCommonInputContainer());  
           mgr->ConnectInput(taskCl,  1, (AliAnalysisDataContainer*)coa->FindObject(Form("%sCl2MC%s", res->GetName(), suffix[itq])));
index dcbc5bf6c35c837281b8b27e201f7d06af47f2a2..39cd8418b8e3814239ae566d499666a9f18d7045 100644 (file)
@@ -117,22 +117,22 @@ void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890
   
   // INITIALIZATION OF RUNNING ENVIRONMENT
   // initialize OCDB manager
-  AliCDBManager *cdbManager = AliCDBManager::Instance();
-  cdbManager->SetDefaultStorage(ocdb_uri);
-  if(!cdbManager->IsDefaultStorageSet()){
-    Error("run.C", "Error setting OCDB.");
-    return;
-  }
-  cdbManager->SetRun(runNo);
-  cdbManager->SetSpecificStorage("GRP/GRP/Data", grp_uri);
-  cdbManager->SetCacheFlag(kFALSE);
-  cdbManager->Print();
-  // initialize magnetic field from the GRP manager.
-  AliGRPManager grpMan;
-  if(!grpMan.ReadGRPEntry()) return;
-  if(!grpMan.SetMagField()) return;
-  //AliRunInfo *runInfo = grpMan.GetRunInfo();
-  AliGeomManager::LoadGeometry();
+//   AliCDBManager *cdbManager = AliCDBManager::Instance();
+//   cdbManager->SetDefaultStorage(ocdb_uri);
+//   if(!cdbManager->IsDefaultStorageSet()){
+//     Error("run.C", "Error setting OCDB.");
+//     return;
+//   }
+//   cdbManager->SetRun(runNo);
+//   cdbManager->SetSpecificStorage("GRP/GRP/Data", grp_uri);
+//   cdbManager->SetCacheFlag(kFALSE);
+//   cdbManager->Print();
+//   // initialize magnetic field from the GRP manager.
+//   AliGRPManager grpMan;
+//   if(!grpMan.ReadGRPEntry()) return;
+//   if(!grpMan.SetMagField()) return;
+//   //AliRunInfo *runInfo = grpMan.GetRunInfo();
+//   AliGeomManager::LoadGeometry();
 
   // DEFINE DATA CHAIN
   TChain *chain = 0x0;
@@ -176,12 +176,9 @@ void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890
   }
   //mgr->PrintStatus();
   mgr->StartAnalysis("local", chain, nev, first);
-
   timer.Stop();
   timer.Print();  
 
-  delete cdbManager;
-
   // verbosity
   printf("\tCLEANING TASK LIST:\n");
   mgr->GetTasks()->Delete();