Major commit related to steering of the reco parameters: AliDAQ and trigger classes...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 21:57:44 +0000 (21:57 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Jul 2008 21:57:44 +0000 (21:57 +0000)
67 files changed:
EVE/EveDet/AliEveTRDData.cxx
GRP/UpdateCDBGRPEntry.C
GRP/UpdateCDBGRPEntryMC.C
HLT/PHOS/AliHLTPHOSClusterizer.cxx
HLT/PHOS/AliHLTPHOSClusterizer.h
HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx
HLT/TRD/AliHLTTRDClusterizerComponent.cxx
HLT/TRD/AliHLTTRDTrackerComponent.cxx
HLT/TRD/AliHLTTRDTrackerV1Component.cxx
ITS/AliITSDetTypeRec.cxx
ITS/AliITSReconstructor.cxx
ITS/AliITSReconstructor.h
MUON/AliMUONReconstructor.cxx
MUON/AliMUONReconstructor.h
PHOS/AliPHOS.cxx
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSQADataMaker.cxx
PHOS/AliPHOSQADataMakerRec.cxx
PHOS/AliPHOSRawDigiProducer.cxx
PHOS/AliPHOSRawDigiProducer.h
PHOS/AliPHOSRecoParam.cxx
PHOS/AliPHOSRecoParam.h
PHOS/AliPHOSReconstructor.cxx
PHOS/AliPHOSReconstructor.h
PHOS/PHOSbaseLinkDef.h
PHOS/libPHOSbase.pkg
RAW/AliDAQ.cxx
RAW/AliDAQ.h
STEER/AliCentralTrigger.cxx
STEER/AliCentralTrigger.h
STEER/AliDetectorRecoParam.cxx
STEER/AliDetectorRecoParam.h
STEER/AliEventInfo.cxx
STEER/AliEventInfo.h
STEER/AliQAChecker.cxx
STEER/AliQAChecker.h
STEER/AliRecoParam.cxx
STEER/AliRecoParam.h
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h
STEER/AliReconstructor.cxx
STEER/AliReconstructor.h
STEER/AliRunInfo.cxx [new file with mode: 0644]
STEER/AliRunInfo.h [new file with mode: 0644]
STEER/AliSimulation.cxx
STEER/AliTriggerInput.cxx
STEER/AliTriggerInput.h
STEER/STEERLinkDef.h
STEER/libSTEER.pkg
TPC/AliTPCReconstructor.cxx
TPC/AliTPCReconstructor.h
TPC/AliTPCcalibDB.cxx
TPC/AliTPCcalibDB.h
TRD/AliTRDReconstructor.cxx
TRD/AliTRDReconstructor.h
TRD/AliTRDchamberTimeBin.cxx
TRD/AliTRDclusterizer.cxx
TRD/AliTRDpidESD.cxx
TRD/AliTRDrecoParam.h
TRD/AliTRDseedV1.cxx
TRD/AliTRDtrackV1.cxx
TRD/AliTRDtracker.cxx
TRD/AliTRDtrackerV1.cxx
TRD/AliTRDtrackingChamber.cxx
test/gun/rec.C
test/gun/recraw/rec.C

index 2ba6e7c9eeab5c0e73504ddd842ca30c5f41c249..5ad5824993999adc98fe9408d37f52346ec723ac 100644 (file)
@@ -351,17 +351,17 @@ void AliEveTRDTrack::ProcessData()
   AliTRDtrackV1 *track = (AliTRDtrackV1*)GetUserData();
   AliInfo(Form("Clusters[%d]", track->GetNumberOfClusters()));
   
-  AliTRDrecoParam *rec = 0x0;
-  if(!(rec = AliTRDReconstructor::RecoParam())){
+  const AliTRDrecoParam *rec = 0x0;
+  if(!(rec = AliTRDReconstructor::GetRecoParam())){
     AliWarning("TRD reco param missing.");
     return;
   } 
-  rec->SetPIDMethod(AliTRDrecoParam::kLQPID);
+  //  rec->SetPIDMethod(AliTRDrecoParam::kLQPID);
   track->CookPID();
   printf("PIDLQ : "); for(int is=0; is<AliPID::kSPECIES; is++) printf("%s[%5.2f] ", AliPID::ParticleName(is), 1.E2*track->GetPID(is)); printf("\n");
 
-  rec->SetPIDMethod(AliTRDrecoParam::kNNPID);
-  track->CookPID();
-  printf("PIDNN : "); for(int is=0; is<AliPID::kSPECIES; is++) printf("%s[%5.2f] ", AliPID::ParticleName(is), 1.E2*track->GetPID(is)); printf("\n");
+  //  rec->SetPIDMethod(AliTRDrecoParam::kNNPID);
+  //  track->CookPID();
+  //  printf("PIDNN : "); for(int is=0; is<AliPID::kSPECIES; is++) printf("%s[%5.2f] ", AliPID::ParticleName(is), 1.E2*track->GetPID(is)); printf("\n");
 }
 
index f59471b49e38bb8dcbae52070ba81ad4f8c777d7..1cd290c2eb349cd284cd07e756c292d03cf74baf 100644 (file)
@@ -53,9 +53,9 @@ TMap *GetGRPList(const char* system) {
     map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("14000"));
   else map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("5500"));
   map->Add(new TObjString("fAliceBeamType"),new TObjString(system));
-  map->Add(new TObjString("fNumberOfDetectors"),new TObjString("15"));
-  map->Add(new TObjString("fDetectorMask"),new TObjString("1048575"));
-  map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC07a"));
+  map->Add(new TObjString("fNumberOfDetectors"),new TObjString("21"));
+  map->Add(new TObjString("fDetectorMask"),new TObjString("1074790399"));
+  map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC08c"));
 
   //DCS
   map->Add(new TObjString("fLHCState"),new TObjString("test"));
index d53a17e153b44adf0496c85b7e1bd2d9c7e71505..9e66496a0c88c08fd76bb0a20844e3a48a9f5463 100644 (file)
@@ -170,8 +170,8 @@ TMap *GetGRPList() {
        map->Add(new TObjString("fAliceBeamEnergy"),new TObjString(ParseConfig("fAliceBeamEnergy")));
   map->Add(new TObjString("fAliceBeamType"),new TObjString(system));
   map->Add(new TObjString("fNumberOfDetectors"),new TObjString(ParseConfig("fNumberOfDetectors")));
-  map->Add(new TObjString("fDetectorMask"),new TObjString("1048575"));
-  map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC07a"));
+  map->Add(new TObjString("fDetectorMask"),new TObjString("1074790399"));
+  map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC08c"));
 
   //DCS
   map->Add(new TObjString("fLHCState"),new TObjString("0"));
index 22e861cc7c2549d6fba6d438e308bccfc030c01d..a0ea8356211b3e5b567f3994573d0513e9442fb7 100644 (file)
@@ -36,7 +36,7 @@
 #include "TClonesArray.h"
 #include "AliPHOSGeometry.h"
 #include "AliPHOSDigit.h"
-#include "AliPHOSRecoParamEmc.h"
+#include "AliPHOSRecoParam.h"
 
 ClassImp(AliHLTPHOSClusterizer);
 
@@ -80,12 +80,12 @@ AliHLTPHOSClusterizer::SetRecPointContainer(AliHLTPHOSRecPointContainerStruct* r
   }
 
 void
-AliHLTPHOSClusterizer::SetRecoParameters(AliPHOSRecoParamEmc* params)
+AliHLTPHOSClusterizer::SetRecoParameters(AliPHOSRecoParam* params)
 {
   //see header file for documentation
-  fEmcClusteringThreshold = params->GetClusteringThreshold();
-  fEmcMinEnergyThreshold = params->GetMinE();
-  fLogWeight = params->GetLogWeight();
+  fEmcClusteringThreshold = params->GetEMCClusteringThreshold();
+  fEmcMinEnergyThreshold = params->GetEMCMinE();
+  fLogWeight = params->GetEMCLogWeight();
 }
 
 void
index 0c15ba8006d89ff084ea7435f34a3829b0da50b6..9036c2baa5d6b25b8f6be93145c83f8fbcfa4ff3 100644 (file)
@@ -45,7 +45,7 @@
 
 class TClonesArray;
 class AliPHOSDigit;
-class AliPHOSRecoParamEmc;
+class AliPHOSRecoParam;
 
 /** 
  * @class AliHLTPHOSClusterizer
@@ -102,7 +102,7 @@ public:
 
 
   /** Set reco parameters */
-  void SetRecoParameters(AliPHOSRecoParamEmc* recoPars);
+  void SetRecoParameters(AliPHOSRecoParam* recoPars);
 
   /** Set emc clustering threshold */
   void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
index e1c6731ecd2379e4db1925c4a3c1b071f283dbae..befd5b88fe8a4160cf83ef4d19e497f07139ee01 100644 (file)
@@ -153,7 +153,8 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv )
   //AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam();
   AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetHLTParam();
   if(tpcRecoParam) {
-    AliTPCReconstructor::SetRecoParam(tpcRecoParam);
+    AliTPCReconstructor tpcReconstructor;
+    tpcReconstructor.SetRecoParam(tpcRecoParam);
   }
  
   // TPC geometry parameters
index 8b19d86047610e2c71c42c59ab191183d59b26ad..c349d81421f6287150893e6155dc9107255ca498 100644 (file)
@@ -248,7 +248,7 @@ int AliHLTTRDClusterizerComponent::DoInit( int argc, const char** argv )
       return -1;
     }
 
-  AliTRDReconstructor::SetRecoParam(fRecoParam);
+  AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fRecoParam);
 
   // init the raw data type to be used...
   // the switch here will become obsolete as soon as the data structures is fixed 
index 978ccacd42b61872610b4157e00214763366c428..5955d0c9071726214e599cabe95581b77802a80a 100644 (file)
@@ -191,7 +191,7 @@ int AliHLTTRDTrackerComponent::DoInit( int argc, const char** argv )
        AliTRDrecoParam *fPars = AliTRDrecoParam::GetLowFluxParam();
                        fPars->SetSeeding(kTRUE);
                        fPars->SetStreamLevel(0);
-                       AliTRDReconstructor::SetRecoParam(fPars);
+                       AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fPars);
       fTracker = new AliTRDtracker(fGeometryFile);
       //fTracker = new AliTRDtracker(fGeometryFile);
     }
index 435d456e7bd4c98946edfa13f390be98958858d5..819934b161aa9e94c49443e4b50128c6d1b68df1 100644 (file)
@@ -311,7 +311,7 @@ int AliHLTTRDTrackerV1Component::DoInit( int argc, const char** argv )
   // no debug stream -> no debug files! on HLT
   fRecoParam->SetStreamLevel(0);
   
-  AliTRDReconstructor::SetRecoParam(fRecoParam);
+  AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fRecoParam);
     
   // geometry:
   // for some unknown at this point reason (30th of April 2008)
index e217bdbd921e0cdba583224240eced39a923240e..898e943ebf8df8d4be6b25b953c206a03360811a 100644 (file)
@@ -453,8 +453,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD");
   AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
   AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");
-  // Entry for the AliITSRecoParam object
-  AliCDBEntry *entryRP = AliCDBManager::Instance()->Get("ITS/Calib/RecoParam/");
   AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD");
   AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD");
   AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD");
@@ -528,18 +526,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   if(!cacheStatus)entry2SSD->SetObject(NULL);
   entry2SSD->SetOwner(kTRUE);
 
-  if(!AliITSReconstructor::GetRecoParam()){
-    if(!entryRP) AliFatal("Calibration object (RecoParam) retrieval from OCDB failed! Hint: as an alternative you can set it in your reconstruction macro ");
-    AliITSRecoParam *rp = (AliITSRecoParam*)entryRP->GetObject();
-    if(!cacheStatus)entryRP->SetObject(NULL);
-    entryRP->SetOwner(kTRUE);
-    AliITSReconstructor::SetRecoParam(rp);
-  }
-  else {
-    AliWarning("AliITSRecoParam object has been already set in AliITSReconstructor. The OCDB instance will not be used\n");
-  }
-
-
   // DB entries are deleted. In this way metadeta objects are deleted as well
   if(!cacheStatus){
     delete entrySPD;
index 0f864661a395c8c082f5527b5dbe8cf437fa8331..0d839490a5e5cf00427a0e07435cb86c396f8f4c 100644 (file)
@@ -44,7 +44,6 @@
 
 
 ClassImp(AliITSReconstructor)
-AliITSRecoParam *AliITSReconstructor::fgRecoParam =0;  // reconstruction parameters
 
 //___________________________________________________________________________
 AliITSReconstructor::AliITSReconstructor() : AliReconstructor(),
@@ -57,7 +56,6 @@ fDetTypeRec(0)
 AliITSReconstructor::~AliITSReconstructor(){
 // destructor
   delete fItsPID;
-  //  if(!fgRecoParam) delete fgRecoParam;
   if(fDetTypeRec) delete fDetTypeRec;
 } 
 //______________________________________________________________________
@@ -96,12 +94,6 @@ void AliITSReconstructor::Init() {
     fDetTypeRec->SetITSgeom(geom);
     fDetTypeRec->SetDefaults();
 
-    if(fgRecoParam) {
-      fgRecoParam->PrintParameters();
-    } else {
-      AliWarning("AliITSRecoParam has not been set");
-    } 
-    
     return;
 }
 
index 551b77401d144b4cc4f2128c850abecb352d8e21..8867481818905b12dabf61f2d6cbb03a7e079559 100644 (file)
@@ -39,16 +39,14 @@ public:
                               AliESDEvent* esd) const
   {FillESD((TTree*)NULL, clustersTree, esd);}
 
-  static void SetRecoParam(AliITSRecoParam * param){ fgRecoParam = param;}
-  static const AliITSRecoParam* GetRecoParam(){ return fgRecoParam;}
+  static const AliITSRecoParam* GetRecoParam() { return dynamic_cast<const AliITSRecoParam*>(AliReconstructor::GetRecoParam(0)); }
 
 private:
   //data
-  static AliITSRecoParam *fgRecoParam; // reconstruction parameters
   AliITSpidESD           *fItsPID;      // Pid for ITS
   AliITSDetTypeRec       *fDetTypeRec;  // reconstructor
 
-  ClassDef(AliITSReconstructor, 5)   // class for the ITS reconstruction
+  ClassDef(AliITSReconstructor, 6)   // class for the ITS reconstruction
 };
 
 #endif
index 0948e4fe1e3ad04b0db173073be7ede215b2a5d8..a26a8f89bf528cfaae85a3a08852443f85e260c7 100644 (file)
 #include "AliMUONPreClusterFinder.h"
 #include "AliMUONPreClusterFinderV2.h"
 #include "AliMUONPreClusterFinderV3.h"
-#include "AliMUONRecoParam.h"
 #include "AliMUONSimpleClusterServer.h"
 #include "AliMUONTracker.h"
 #include "AliMUONTriggerCircuit.h"
 #include "AliMpCDB.h"
 #include "AliMpConstants.h"
 
-#include "AliRecoParam.h"
 #include "AliRawReader.h"
 #include "AliCDBManager.h"
 #include "AliCodeTimer.h"
 ClassImp(AliMUONReconstructor)
 /// \endcond 
 
-AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters
-
 //_____________________________________________________________________________
 AliMUONReconstructor::AliMUONReconstructor() : 
 AliReconstructor(),
@@ -173,20 +169,6 @@ AliMUONReconstructor::~AliMUONReconstructor()
   delete fClusterStore;
 }
 
-//_____________________________________________________________________________
-const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam()
-{
-  /// get reconstruction parameters
-  
-  // initialize reconstruction parameters if not already done
-  if (!fgRecoParam) {
-    cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<<endl;
-    fgRecoParam = AliMUONRecoParam::GetLowFluxParam();
-  }
-  
-  return fgRecoParam;
-}
-
 //_____________________________________________________________________________
 void
 AliMUONReconstructor::Calibrate(AliMUONVDigitStore& digitStore) const
index c2796962b84a5a4c877574722d9b8b0e64207bfe..81c2f145a44f60ab2222b865f8c1b2afc59d2adf 100644 (file)
@@ -32,6 +32,9 @@ class AliMUONVTriggerStore;
 class AliMUONVTriggerStore;
 class TClonesArray;
 
+#include "AliDetectorRecoParam.h"
+#include "AliMUONRecoParam.h"
+
 class AliMUONReconstructor : public AliReconstructor
 {
 public:
@@ -48,8 +51,7 @@ public:
   
   virtual AliTracker* CreateTracker() const;
   
-  static void                    SetRecoParam(AliMUONRecoParam* recoParam) {fgRecoParam = recoParam;}
-  static const AliMUONRecoParam* GetRecoParam();
+  static const AliMUONRecoParam* GetRecoParam() { return dynamic_cast<const AliMUONRecoParam*>(AliReconstructor::GetRecoParam(7)); }
   
   static AliMUONVClusterFinder* CreateClusterFinder(const char* clusterFinderType);
 
@@ -86,9 +88,7 @@ private:
   mutable AliMUONVTrackStore* fTrackStore; //!< Track container
   mutable AliMUONVClusterStore* fClusterStore; //!< cluster store (when not in combined tracking mode)
   
-  static AliMUONRecoParam* fgRecoParam; //!< parameters used to tune the MUON reconstruction
-    
-  ClassDef(AliMUONReconstructor,7) // Implementation of AliReconstructor
+  ClassDef(AliMUONReconstructor,8) // Implementation of AliReconstructor
 };
 
 #endif
index b6aa2ba507754153d43450036316eefd8cae5a94..7825d45c9449729a58ad7b82b1d2386ffac6d6be 100644 (file)
@@ -96,9 +96,8 @@ class TFile;
 #include "AliPHOSRawDecoder.h"
 #include "AliPHOSRawDigiProducer.h"
 #include "AliPHOSQAChecker.h"
-#include "AliPHOSRecoParamEmc.h"
+#include "AliPHOSRecoParam.h"
 #include "AliPHOSSimParam.h"
-#include "AliPHOSCpvRawWrite.h"
 
 ClassImp(AliPHOS)
 
@@ -442,7 +441,7 @@ void AliPHOS::Digits2Raw()
   }
 
   // get mapping from OCDB
-  const TObjArray* maps = AliPHOSRecoParamEmc::GetMappings();
+  const TObjArray* maps = AliPHOSRecoParam::GetMappings();
   if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
 
   // some digitization constants
@@ -473,15 +472,6 @@ void AliPHOS::Digits2Raw()
   Float_t eMax=-333;
   //!!!for debug!!!
 
-  TObjArray *cpvDigitsAll = new TObjArray();
-  TClonesArray *cpvDigitsModule;
-  Int_t *nCPVdigits = new Int_t[geom->GetNModules()];
-  Int_t module;
-  for (module=0; module<geom->GetNModules(); module++) {
-    cpvDigitsAll->Add(new TClonesArray("AliPHOSDigit",100));
-    nCPVdigits[module] = 0;
-  }
-
   // loop over digits (assume ordered digits)
   for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) {
     AliPHOSDigit* digit = dynamic_cast<AliPHOSDigit *>(digits->At(iDigit)) ;
@@ -489,19 +479,13 @@ void AliPHOS::Digits2Raw()
     // Skip small energy below treshold
     if (digit->GetEnergy() < kThreshold) 
       continue;
+    // Skip CPV digits
+    if (digit->GetId() > geom->GetNModules() * geom->GetNCristalsInModule()) 
+      continue;
 
     Int_t relId[4];
     geom->AbsToRelNumbering(digit->GetId(), relId);
-    module = relId[0];
-
-    // Fill TObjArray  of TClonesArray's with CPV digits per module
-    if (digit->GetId() > geom->GetNModules() * geom->GetNCristalsInModule()) {
-      cpvDigitsModule = (TClonesArray*)cpvDigitsAll->At(module-1);
-      new((*cpvDigitsModule)[nCPVdigits[module-1]++]) 
-       AliPHOSDigit(-1,digit->GetId(),digit->GetAmp(),digit->GetTime());
-      continue;
-    }
-
+    Int_t module = relId[0];
  
     // Begin FIXME 
     if (relId[1] != 0) 
@@ -595,16 +579,6 @@ void AliPHOS::Digits2Raw()
         modMax,colMax,rowMax,eMax));
 
   delete pulse;
-
-  for (module=0; module<geom->GetNModules(); module++) {
-    AliDebug(2,Form("Number of CPV digits in module %d: %d/%d",
-                   module,
-                   ((TClonesArray*)cpvDigitsAll->At(module))->GetEntriesFast(),
-                   nCPVdigits[module]));
-  }
-  AliPHOSCpvRawWrite *cpvRaw = new AliPHOSCpvRawWrite();
-  cpvRaw->WriteRaw(cpvDigitsAll);
-  delete cpvRaw;
   loader->UnloadDigits();
 }
 
index 4450e4d56be29793ca2d54aab8581dc8064e2e79..33098168647765d97783799e9ade37d28da9eb91 100644 (file)
@@ -202,7 +202,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() :
 {
   // default ctor (to be used mainly by Streamer)
   
-  InitParameters() ; 
   fDefaultInit = kTRUE ; 
 }
 
@@ -218,7 +217,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(AliPHOSGeometry *geom) :
 {
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
-  InitParameters() ;
   Init() ;
   fDefaultInit = kFALSE ; 
 }
@@ -383,25 +381,22 @@ void AliPHOSClusterizerv1::InitParameters()
   fNumberOfCpvClusters     = 0 ; 
   fNumberOfEmcClusters     = 0 ; 
 
-  const AliPHOSRecoParam* parEmc = AliPHOSReconstructor::GetRecoParamEmc();
-  if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!");
+  const AliPHOSRecoParam* recoParam = AliPHOSReconstructor::GetRecoParam();
+  if(!recoParam) AliFatal("Reconstruction parameters are not set!");
 
-  const AliPHOSRecoParam* parCpv = AliPHOSReconstructor::GetRecoParamCpv(); 
-  if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!");
-
-  fCpvClusteringThreshold  = parCpv->GetClusteringThreshold();
-  fEmcClusteringThreshold  = parEmc->GetClusteringThreshold();
+  fCpvClusteringThreshold  = recoParam->GetEMCClusteringThreshold();
+  fEmcClusteringThreshold  = recoParam->GetCPVClusteringThreshold();
   
-  fEmcLocMaxCut            = parEmc->GetLocalMaxCut();
-  fCpvLocMaxCut            = parCpv->GetLocalMaxCut();
+  fEmcLocMaxCut            = recoParam->GetEMCLocalMaxCut();
+  fCpvLocMaxCut            = recoParam->GetCPVLocalMaxCut();
 
-  fW0                      = parEmc->GetLogWeight();
-  fW0CPV                   = parCpv->GetLogWeight();
+  fW0                      = recoParam->GetEMCLogWeight();
+  fW0CPV                   = recoParam->GetCPVLogWeight();
 
   fEmcTimeGate             = 1.e-6 ; 
-  fEcoreRadius             = parEmc->GetEcoreRadius();
+  fEcoreRadius             = recoParam->GetEMCEcoreRadius();
   
-  fToUnfold                = parEmc->ToUnfold() ;
+  fToUnfold                = recoParam->EMCToUnfold() ;
     
   fWrite                   = kTRUE ;
 }
@@ -489,7 +484,7 @@ void AliPHOSClusterizerv1::WriteRecPoints()
   Int_t index ;
   //Evaluate position, dispersion and other RecPoint properties..
   Int_t nEmc = fEMCRecPoints->GetEntriesFast();
-  Float_t emcMinE= AliPHOSReconstructor::GetRecoParamEmc()->GetMinE(); //Minimal digit energy
+  Float_t emcMinE= AliPHOSReconstructor::GetRecoParam()->GetEMCMinE(); //Minimal digit energy
   TVector3 fakeVtx(0.,0.,0.) ;
   for(index = 0; index < nEmc; index++){
     AliPHOSEmcRecPoint * rp =
index 49c9fa46a5be97f128537dcc9460ef59b3664de7..1f9748a3aa20bd3d8b185cdf21ff4927029a0862 100644 (file)
@@ -75,6 +75,8 @@ public:
   AliPHOSClusterizerv1() ;
   AliPHOSClusterizerv1(AliPHOSGeometry *geom);
   virtual ~AliPHOSClusterizerv1()  ;
+
+  void    InitParameters() ;
   
   virtual Int_t   AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ; 
                                // Checks if digits are in neighbour cells 
@@ -130,7 +132,6 @@ private:
   Bool_t  FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy, 
                  Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
   void    Init() ;
-  void    InitParameters() ;
 
   virtual void   MakeUnfolding() ;
   void           UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax, 
index 7794d7f29c791726389e712b986edd6db4777234..640eb1d68991139d4af0c5163be0be2d75da6cd7 100644 (file)
@@ -315,7 +315,7 @@ void AliPHOSQADataMaker::MakeRaws(AliRawReader* rawReader)
   const Int_t modMax = 5 ; 
   rawReader->Reset() ; 
   AliPHOSRawDecoder decoder(rawReader);
-  decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals());
+  decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParam()->EMCSubtractPedestals());
   Int_t count = 0 ; 
   while (decoder.NextDigit()) {
    Int_t module  = decoder.GetModule() ;
index 5dff7f133d1b185578525663179c8ba872d58d5e..fb8d97835dc8209dc3c0b7ceb6230bd26b26190c 100644 (file)
@@ -227,14 +227,14 @@ void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   //Fill prepared histograms with Raw digit properties
   rawReader->Reset() ;
   AliPHOSRawDecoder * decoder ;
-  if(strcmp(AliPHOSReconstructor::GetRecoParamEmc()->DecoderVersion(),"v1")==0)
+  if(strcmp(AliPHOSReconstructor::GetRecoParam()->EMCDecoderVersion(),"v1")==0)
     decoder=new AliPHOSRawDecoderv1(rawReader);
   else
-    if(strcmp(AliPHOSReconstructor::GetRecoParamEmc()->DecoderVersion(),"v2")==0)
+    if(strcmp(AliPHOSReconstructor::GetRecoParam()->EMCDecoderVersion(),"v2")==0)
       decoder=new AliPHOSRawDecoderv2(rawReader);
     else
       decoder=new AliPHOSRawDecoder(rawReader);
-  decoder->SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals());
+  decoder->SubtractPedestals(AliPHOSReconstructor::GetRecoParam()->EMCSubtractPedestals());
   Double_t lgEtot=0. ;
   Double_t hgEtot=0. ;
   Int_t lgNtot=0 ;
index 89116f07784a2674bc4cca1085585a59b712ee8d..88dba285e13fbdfd3eae574e81e66f6eaad41828 100644 (file)
@@ -47,22 +47,35 @@ ClassImp(AliPHOSRawDigiProducer)
 AliPHOSCalibData * AliPHOSRawDigiProducer::fgCalibData  = 0 ; 
 
 //--------------------------------------------------------------------------------------
-AliPHOSRawDigiProducer::AliPHOSRawDigiProducer():TObject(),
-  fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.),
-  fEmcCrystals(0),fGeom(0),fPulseGenerator(0){
-
+AliPHOSRawDigiProducer::AliPHOSRawDigiProducer():
+  TObject(),
+  fEmcMinE(0.),
+  fCpvMinE(0.),
+  fSampleQualityCut(1.),
+  fEmcCrystals(0),
+  fGeom(0),
+  fPulseGenerator(0)
+{
+  // Default constructor
 }
 //--------------------------------------------------------------------------------------
-AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, const AliPHOSRecoParam* parCpv):TObject(),
-  fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.),fEmcCrystals(0),fGeom(0),fPulseGenerator(0){
+AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* recoParam):
+  TObject(),
+  fEmcMinE(0.),
+  fCpvMinE(0.),
+  fSampleQualityCut(1.),
+  fEmcCrystals(0),
+  fGeom(0),
+  fPulseGenerator(0)
+{
+  // Constructor takes paramerters from recoParam
 
-  if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!");
-  if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!");
+  if(!recoParam) AliFatal("Reconstruction parameters are not set!");
 
-  fEmcMinE = parEmc->GetMinE();
-  fCpvMinE = parCpv->GetMinE();
+  fEmcMinE = recoParam->GetEMCMinE();
+  fCpvMinE = recoParam->GetCPVMinE();
 
-  fSampleQualityCut = parEmc->GetSampleQualityCut() ;
+  fSampleQualityCut = recoParam->GetEMCSampleQualityCut() ;
 
   fGeom=AliPHOSGeometry::GetInstance() ;
   if(!fGeom) fGeom = AliPHOSGeometry::GetInstance("IHEP");
@@ -74,8 +87,16 @@ AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, c
   GetCalibrationParameters() ; 
 }
 //--------------------------------------------------------------------------------------                       
-AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp):TObject(),
-  fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.),fEmcCrystals(0),fGeom(0),fPulseGenerator(0){                                                          
+AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp):
+  TObject(),
+  fEmcMinE(0.),
+  fCpvMinE(0.),
+  fSampleQualityCut(1.),
+  fEmcCrystals(0),
+  fGeom(0),
+  fPulseGenerator(0)
+{                                                          
+  // Copy constructor
 
   fEmcMinE = dp.fEmcMinE ;
   fCpvMinE = dp.fCpvMinE ;
@@ -84,7 +105,10 @@ AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp)
   fGeom = dp.fGeom ;
 }
 //--------------------------------------------------------------------------------------
-AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiProducer &dp){
+AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiProducer &dp)
+{
+  // Assign operator
+
   if(&dp == this) return *this;
 
   fEmcMinE = dp.fEmcMinE ;
@@ -97,9 +121,11 @@ AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiP
   return  *this;
 } 
 //--------------------------------------------------------------------------------------                                                   
-AliPHOSRawDigiProducer::~AliPHOSRawDigiProducer(){
- if(fPulseGenerator) delete fPulseGenerator ;
- fPulseGenerator=0 ;
+AliPHOSRawDigiProducer::~AliPHOSRawDigiProducer()
+{
+  // Desctructor
+  if(fPulseGenerator) delete fPulseGenerator ;
+  fPulseGenerator=0 ;
 }
 //--------------------------------------------------------------------------------------
 void AliPHOSRawDigiProducer::MakeDigits(TClonesArray *digits, AliPHOSRawDecoder* decoder) 
@@ -125,7 +151,7 @@ void AliPHOSRawDigiProducer::MakeDigits(TClonesArray *digits, AliPHOSRawDecoder*
     if(energy<=baseLine) //in ADC channels
       continue ;
 
-    //remove digits with bas shape. Decoder should calculate quality so that 
+    //remove digits with bad shape. Decoder should calculate quality so that 
     //in default case quality [0,1], while larger values of quality mean somehow 
     //corrupted samples, 999 means obviously corrupted sample.
     //It is difficult to fit samples with overflow (even setting cut on overflow values)
index 004afce2116ed6d4b48ab8ee21700932e8968b40..58aaf2f65f25ebc806705b4b006096088f38cc83 100644 (file)
@@ -21,7 +21,7 @@ class AliPHOSRawDigiProducer: public TObject {
 public:
 
   AliPHOSRawDigiProducer() ;
-  AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, const AliPHOSRecoParam* parCpv) ;
+  AliPHOSRawDigiProducer(const AliPHOSRecoParam* recoParam) ;
   AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp);
   AliPHOSRawDigiProducer& operator= (const AliPHOSRawDigiProducer &dp);
  
@@ -45,10 +45,10 @@ private:
   Float_t fCpvMinE ;                 // minimum energy of digit to be included into cluster
   Float_t fSampleQualityCut;         // Cut on sample shapes: 0: no samples; 1: default parameterization; 999: accept even obviously bad
 
-  Int_t fEmcCrystals ;               //  number of EMC crystalls
+  Int_t fEmcCrystals ;               //  number of EMC crystals
   AliPHOSGeometry * fGeom ;          //! PHOS geometry
-  static AliPHOSCalibData * fgCalibData ;   //! Calibration database if aval.
-  AliPHOSPulseGenerator * fPulseGenerator ; //! Class with pulse parameters
+  static AliPHOSCalibData * fgCalibData ;   //! Calibration database if avalable
+  AliPHOSPulseGenerator * fPulseGenerator ; //! Class with pulse shape parameters
 
   ClassDef(AliPHOSRawDigiProducer,2)
 };
index 1811e0c4a47761a946139fe8478c723c6aefb282..9b5aed093d1527bce64ec7ffb03b25c5e14c72a2 100644 (file)
 // Author: Boris Polichtchouk.
 
 // --- AliRoot header files ---
+#include "AliCDBManager.h"
+#include "AliCDBEntry.h"
 #include "AliPHOSRecoParam.h"
 
 ClassImp(AliPHOSRecoParam)
 
+TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
+
 //-----------------------------------------------------------------------------
 AliPHOSRecoParam::AliPHOSRecoParam() :
   AliDetectorRecoParam(),
-  fClusteringThreshold(9999),
-  fLocMaxCut(9999),
-  fMinE(9999),
-  fW0(9999),
-  fSampleQualityCut(1.),
-  fEcoreRadius(3.),
-  fEcore2ESD(kFALSE),
-  fSubtractPedestals(kTRUE),
-  fUnfold(kTRUE),
-  fDecoderVersion("")
+  fEMCClusteringThreshold(0.2),
+  fEMCLocMaxCut(0.03),
+  fEMCMinE(0.01),
+  fEMCW0(4.5),
+  fEMCSampleQualityCut(1.),
+  fEMCEcoreRadius(3.),
+  fEMCEcore2ESD(kFALSE),
+  fEMCSubtractPedestals(kTRUE),
+  fEMCUnfold(kTRUE),
+  fEMCDecoderVersion(""),
+  fCPVClusteringThreshold(0.0),
+  fCPVLocMaxCut(0.03),
+  fCPVMinE(0.0),
+  fCPVW0(4.0),
+  fCPVUnfold(kTRUE)
 {
   //Default constructor.
 }
@@ -44,16 +53,21 @@ AliPHOSRecoParam::AliPHOSRecoParam() :
 //-----------------------------------------------------------------------------
 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
   AliDetectorRecoParam(),
-  fClusteringThreshold(9999),
-  fLocMaxCut(9999),
-  fMinE(9999),
-  fW0(9999),
-  fSampleQualityCut(1.),
-  fEcoreRadius(3.),
-  fEcore2ESD(kFALSE),
-  fSubtractPedestals(kTRUE),
-  fUnfold(kTRUE),
-  fDecoderVersion("")
+  fEMCClusteringThreshold(0.2),
+  fEMCLocMaxCut(0.03),
+  fEMCMinE(0.01),
+  fEMCW0(4.5),
+  fEMCSampleQualityCut(1.),
+  fEMCEcoreRadius(3.),
+  fEMCEcore2ESD(kFALSE),
+  fEMCSubtractPedestals(kTRUE),
+  fEMCUnfold(kTRUE),
+  fEMCDecoderVersion(""),
+  fCPVClusteringThreshold(0.0),
+  fCPVLocMaxCut(0.03),
+  fCPVMinE(0.0),
+  fCPVW0(4.0),
+  fCPVUnfold(kTRUE)
 {
   //Copy constructor.
 }
@@ -64,16 +78,53 @@ AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoPara
   //Assignment operator.
 
   if(this != &recoParam) {
-    fClusteringThreshold = recoParam.fClusteringThreshold;
-    fLocMaxCut           = recoParam.fLocMaxCut;
-    fMinE                = recoParam.fMinE;
-    fW0                  = recoParam.fW0;
-    fSampleQualityCut    = recoParam.fSampleQualityCut ;
-    fEcoreRadius         = recoParam.fEcoreRadius ;
-    fSubtractPedestals   = recoParam.fSubtractPedestals;
-    fUnfold              = recoParam.fUnfold;
-    fDecoderVersion      = recoParam.fDecoderVersion ;
+    fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
+    fEMCLocMaxCut           = recoParam.fEMCLocMaxCut;
+    fEMCMinE                = recoParam.fEMCMinE;
+    fEMCW0                  = recoParam.fEMCW0;
+    fEMCSampleQualityCut    = recoParam.fEMCSampleQualityCut;
+    fEMCEcoreRadius         = recoParam.fEMCEcoreRadius;
+    fEMCEcore2ESD           = recoParam.fEMCEcore2ESD;
+    fEMCSubtractPedestals   = recoParam.fEMCSubtractPedestals;
+    fEMCUnfold              = recoParam.fEMCUnfold;
+    fEMCDecoderVersion      = recoParam.fEMCDecoderVersion;
+    fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
+    fCPVLocMaxCut           = recoParam.fCPVLocMaxCut;
+    fCPVMinE                = recoParam.fCPVMinE;
+    fCPVW0                  = recoParam.fCPVW0;
+    fCPVUnfold              = recoParam.fCPVUnfold;
   }
 
   return *this;
 }
+
+//-----------------------------------------------------------------------------
+AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
+{
+  //Default parameters for the reconstruction
+
+  AliPHOSRecoParam* params = new AliPHOSRecoParam();
+  return params;
+}
+
+//-----------------------------------------------------------------------------
+const TObjArray* AliPHOSRecoParam::GetMappings()
+{
+  //Returns array of AliAltroMappings for RCU0..RCU3.
+  //If not found, read it from OCDB.
+
+  //Quick check as follows:
+  //  root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+  //  root [1] AliCDBManager::Instance()->SetRun(1);
+  //  root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
+  //  root [3] maps->Print();
+  
+  if(fgkMaps) return fgkMaps;
+  
+  AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
+  if(entry)
+    fgkMaps = (TObjArray*)entry->GetObject();
+  
+  return fgkMaps;
+  
+}
index e4a31e7eff393561e7c0bd820680b0b51f703a4c..96c7a740a6519bdde91b2a92397f71bc91036a99 100644 (file)
@@ -19,42 +19,65 @@ public:
   AliPHOSRecoParam& operator = (const AliPHOSRecoParam& recoParam);
   virtual ~AliPHOSRecoParam() {}
 
-  Float_t GetClusteringThreshold() const { return fClusteringThreshold;  }
-  Float_t GetLocalMaxCut()         const { return fLocMaxCut;            }
-  Float_t GetMinE()                const { return fMinE;                 }
-  Float_t GetLogWeight()           const { return fW0;                   }
-  Float_t GetSampleQualityCut()    const { return fSampleQualityCut;     }
-  Float_t GetEcoreRadius()         const { return fEcoreRadius;          }
-  Bool_t  Ecore2ESD()              const { return fEcore2ESD;            }
-  Bool_t  SubtractPedestals()      const { return fSubtractPedestals;    }
-  Bool_t  ToUnfold()               const { return fUnfold;               }
-  const char* DecoderVersion()     const { return fDecoderVersion.Data();}
-
-  void SetClusteringThreshold(Float_t cluth)      { fClusteringThreshold=cluth;   }
-  void SetLocalMaxCut(Float_t cut)                { fLocMaxCut          =cut;     }
-  void SetMinE(Float_t minE)                      { fMinE               =minE;    }
-  void SetLogWeight(Float_t w)                    { fW0                 =w;       }
-  void SetSampleQualityCut(Float_t qu)            { fSampleQualityCut   =qu;      }
-  void SetEcoreRadius(Float_t rCore)              { fEcoreRadius        =rCore;   }
-  void SetEcore2ESD(Bool_t ecore)                 { fEcore2ESD          =ecore;   }
-  void SetSubtractPedestals(Bool_t subtract)      { fSubtractPedestals  =subtract;} 
-  void SetDecoderVersion(const char* version="v1"){fDecoderVersion      =version ;}
-  void SetUnfolding(Bool_t toUnfold=kFALSE)       {fUnfold              =toUnfold;}
+  Float_t GetEMCClusteringThreshold() const { return fEMCClusteringThreshold;  }
+  Float_t GetEMCLocalMaxCut()         const { return fEMCLocMaxCut;            }
+  Float_t GetEMCMinE()                const { return fEMCMinE;                 }
+  Float_t GetEMCLogWeight()           const { return fEMCW0;                   }
+  Float_t GetEMCSampleQualityCut()    const { return fEMCSampleQualityCut;     }
+  Float_t GetEMCEcoreRadius()         const { return fEMCEcoreRadius;          }
+  Bool_t  EMCEcore2ESD()              const { return fEMCEcore2ESD;            }
+  Bool_t  EMCSubtractPedestals()      const { return fEMCSubtractPedestals;    }
+  Bool_t  EMCToUnfold()               const { return fEMCUnfold;               }
+  const char* EMCDecoderVersion()     const { return fEMCDecoderVersion.Data();}
+
+  Float_t GetCPVClusteringThreshold() const { return fCPVClusteringThreshold;  }
+  Float_t GetCPVLocalMaxCut()         const { return fCPVLocMaxCut;            }
+  Float_t GetCPVMinE()                const { return fCPVMinE;                 }
+  Float_t GetCPVLogWeight()           const { return fCPVW0;                   }
+  Bool_t  CPVToUnfold()               const { return fCPVUnfold;               }
+
+  void SetEMCClusteringThreshold(Float_t cluth)      { fEMCClusteringThreshold=cluth;   }
+  void SetEMCLocalMaxCut(Float_t cut)                { fEMCLocMaxCut          =cut;     }
+  void SetEMCMinE(Float_t minE)                      { fEMCMinE               =minE;    }
+  void SetEMCLogWeight(Float_t w)                    { fEMCW0                 =w;       }
+  void SetEMCSampleQualityCut(Float_t qu)            { fEMCSampleQualityCut   =qu;      }
+  void SetEMCEcoreRadius(Float_t rCore)              { fEMCEcoreRadius        =rCore;   }
+  void SetEMCEcore2ESD(Bool_t ecore)                 { fEMCEcore2ESD          =ecore;   }
+  void SetEMCSubtractPedestals(Bool_t subtract)      { fEMCSubtractPedestals  =subtract;} 
+  void SetEMCDecoderVersion(const char* version="v1"){ fEMCDecoderVersion     =version ;}
+  void SetEMCUnfolding(Bool_t toUnfold=kFALSE)       { fEMCUnfold            =toUnfold;}
+
+  void SetCPVClusteringThreshold(Float_t cluth)      { fCPVClusteringThreshold=cluth;   }
+  void SetCPVLocalMaxCut(Float_t cut)                { fCPVLocMaxCut          =cut;     }
+  void SetCPVMinE(Float_t minE)                      { fCPVMinE               =minE;    }
+  void SetCPVLogWeight(Float_t w)                    { fCPVW0                 =w;       }
+  void SetCPVUnfolding(Bool_t toUnfold=kFALSE)       { fCPVUnfold            =toUnfold;}
+
+  static AliPHOSRecoParam* GetDefaultParameters();
+  static const  TObjArray* GetMappings();
 
 protected:
 
-  Float_t fClusteringThreshold; // Min.digit energy to start a new cluster, in GeV
-  Float_t fLocMaxCut;           // Min.energy difference between two local maxima, in GeV
-  Float_t fMinE;                // Min.E in the digits list associated with rec.point, in GeV
-  Float_t fW0;                  // Log.weight to evaluate a local coordinate of rec.point
-  Float_t fSampleQualityCut;    // Cut on pusle shape fit quality
-  Float_t fEcoreRadius;         // Radius within which the core energy is calculated, in cm
-  Bool_t  fEcore2ESD;           // true if Ecore is stored in ESD instead of Etot
-  Bool_t  fSubtractPedestals;   // true if pedestal should be subtracted (in non-ZS)
-  Bool_t  fUnfold;              // true if overlapped clusters should be unfolded
-  TString fDecoderVersion ;     // AliPHOSRawDecoder version
-
-  ClassDef(AliPHOSRecoParam,5)
+  Float_t fEMCClusteringThreshold; // EMC: Min.digit energy to start a new cluster, in GeV
+  Float_t fEMCLocMaxCut;           // EMC: Min.energy difference between two local maxima, in GeV
+  Float_t fEMCMinE;                // EMC: Min.E in the digits list associated with rec.point, in GeV
+  Float_t fEMCW0;                  // EMC: Log.weight to evaluate a local coordinate of rec.point
+  Float_t fEMCSampleQualityCut;    // EMC: Cut on pulse shape fit quality
+  Float_t fEMCEcoreRadius;         // EMC: Radius within which the core energy is calculated, in cm
+  Bool_t  fEMCEcore2ESD;           // EMC: true if Ecore is stored in ESD instead of Etot
+  Bool_t  fEMCSubtractPedestals;   // EMC: true if pedestal should be subtracted (in non-ZS)
+  Bool_t  fEMCUnfold;              // EMC: true if overlapped clusters should be unfolded
+  TString fEMCDecoderVersion ;     // EMC: AliPHOSRawDecoder version
+
+  Float_t fCPVClusteringThreshold; // CPV: Min.digit energy to start a new cluster, in GeV
+  Float_t fCPVLocMaxCut;           // CPV: Min.energy difference between two local maxima, in GeV
+  Float_t fCPVMinE;                // CPV: Min.E in the digits list associated with rec.point, in GeV
+  Float_t fCPVW0;                  // CPV: Log.weight to evaluate a local coordinate of rec.point
+  Bool_t  fCPVUnfold;              // CPV: true if overlapped clusters should be unfolded
+
+  static TObjArray* fgkMaps;       // ALTRO mappings for RCU0..RCU3
+
+  ClassDef(AliPHOSRecoParam,6)
 };
 
 #endif
index 8792cebcb528ba5ecfb8444400c522c7839a34ea..d799773288c0a4ee6523622b5190e2641769a4af 100644 (file)
 #include "AliPHOSPIDv1.h"
 #include "AliPHOSTracker.h"
 #include "AliRawReader.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
 #include "AliPHOSTrigger.h"
 #include "AliPHOSGeometry.h"
-#include "AliPHOSRecoParam.h"
-#include "AliPHOSRecoParamEmc.h"
-#include "AliPHOSRecoParamCpv.h"
 #include "AliPHOSDigit.h"
 #include "AliPHOSTrackSegment.h"
 #include "AliPHOSEmcRecPoint.h"
@@ -55,8 +54,6 @@
 ClassImp(AliPHOSReconstructor)
 
 Bool_t AliPHOSReconstructor::fgDebug = kFALSE ; 
-AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamEmc =0;  // EMC rec. parameters
-AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamCpv =0;  // CPV rec. parameters
 TClonesArray*     AliPHOSReconstructor::fgDigitsArray = 0;   // Array of PHOS digits
 TObjArray*        AliPHOSReconstructor::fgEMCRecPoints = 0;   // Array of EMC rec.points
 
@@ -65,17 +62,6 @@ AliPHOSReconstructor::AliPHOSReconstructor() :
   fGeom(NULL),fClusterizer(NULL),fTSM(NULL),fPID(NULL)
 {
   // ctor
-
-  if (!fgkRecoParamEmc) {
-    AliWarning("The Reconstruction parameters for EMC nonitialized - Used default one");
-    fgkRecoParamEmc = AliPHOSRecoParamEmc::GetEmcDefaultParameters();
-  }
-
-  if (!fgkRecoParamCpv) {
-    AliWarning("The Reconstruction parameters for CPV nonitialized - Used default one");
-    fgkRecoParamCpv = AliPHOSRecoParamCpv::GetCpvDefaultParameters();
-  }
-
   fGeom        = AliPHOSGeometry::GetInstance("IHEP","");
   fClusterizer = new AliPHOSClusterizerv1      (fGeom);
   fTSM         = new AliPHOSTrackSegmentMakerv1(fGeom);
@@ -104,6 +90,7 @@ void AliPHOSReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) c
   // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by 
   // the global tracking.
 
+  fClusterizer->InitParameters();
   fClusterizer->SetInput(digitsTree);
   fClusterizer->SetOutput(clustersTree);
   if ( Debug() ) 
@@ -289,7 +276,7 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
     Int_t *primList =  emcRP->GetPrimaries(primMult);
 
     Float_t energy;
-    if (fgkRecoParamEmc->Ecore2ESD())
+    if (GetRecoParam()->EMCEcore2ESD())
       energy = emcRP->GetCoreEnergy();
     else
       energy = rp->Energy();
@@ -354,7 +341,7 @@ void  AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
 
   AliPHOSRawDecoder * dc ;
 
-  const TObjArray* maps = AliPHOSRecoParamEmc::GetMappings();
+  const TObjArray* maps = AliPHOSRecoParam::GetMappings();
   if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
 
   AliAltroMapping *mapping[4];
@@ -362,22 +349,21 @@ void  AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
     mapping[i] = (AliAltroMapping*)maps->At(i);
   }
 
-  if(strcmp(fgkRecoParamEmc->DecoderVersion(),"v1")==0) 
+  if      (strcmp(GetRecoParam()->EMCDecoderVersion(),"v1")==0) 
     dc=new AliPHOSRawDecoderv1(rawReader,mapping);
-  else 
-    if(strcmp(fgkRecoParamEmc->DecoderVersion(),"v2")==0) 
-      dc=new AliPHOSRawDecoderv2(rawReader,mapping);
-    else
-      dc=new AliPHOSRawDecoder(rawReader,mapping);
+  else if (strcmp(GetRecoParam()->EMCDecoderVersion(),"v2")==0) 
+    dc=new AliPHOSRawDecoderv2(rawReader,mapping);
+  else
+    dc=new AliPHOSRawDecoder(rawReader,mapping);
 
-  dc->SubtractPedestals(fgkRecoParamEmc->SubtractPedestals());
+  dc->SubtractPedestals(GetRecoParam()->EMCSubtractPedestals());
   
   TClonesArray *digits = new TClonesArray("AliPHOSDigit",1);
   digits->SetName("DIGITS");
   Int_t bufsize = 32000;
   digitsTree->Branch("PHOS", &digits, bufsize);
 
-  AliPHOSRawDigiProducer pr(fgkRecoParamEmc,fgkRecoParamCpv);
+  AliPHOSRawDigiProducer pr(GetRecoParam());
   pr.MakeDigits(digits,dc);
 
   delete dc ;
index b239d83bdda896e77ad01575481dc47d022c8ff5..278c96dcd3346e22ee657c13d6e33c162a9bc216 100644 (file)
@@ -47,8 +47,9 @@
 
 #include <Riostream.h>
 #include "AliReconstructor.h" 
-#include "AliPHOSRecoParamEmc.h"
-#include "AliPHOSRecoParamCpv.h"
+#include "AliPHOSRecoParam.h"
+// #include "AliPHOSRecoParamEmc.h"
+// #include "AliPHOSRecoParamCpv.h"
 class AliPHOSDigitizer ;
 class AliPHOSClusterizer ;
 class AliPHOSClusterizerv1 ;
@@ -101,29 +102,12 @@ public:
     return *this ; 
   }
   
-  static void SetRecoParamEmc(AliPHOSRecoParam * param){ fgkRecoParamEmc = param;}
-  static void SetRecoParamCpv(AliPHOSRecoParam * param){ fgkRecoParamCpv = param;}
-
-  static const AliPHOSRecoParam* GetRecoParamEmc(){ 
-    if (!fgkRecoParamEmc) {
-      cerr<<"The Reconstruction parameters for EMC nonitialized - Used default one"<<endl;
-      fgkRecoParamEmc = AliPHOSRecoParamEmc::GetEmcDefaultParameters();
-    }
-    return fgkRecoParamEmc;
-  }
-  static const AliPHOSRecoParam* GetRecoParamCpv(){
-    if (!fgkRecoParamCpv) {
-      cerr<<"The Reconstruction parameters for CPV nonitialized - Used default one"<<endl;
-      fgkRecoParamCpv = AliPHOSRecoParamCpv::GetCpvDefaultParameters();
-    }
-    return fgkRecoParamCpv;
-  }
+  static const AliPHOSRecoParam* GetRecoParam() {
+    return dynamic_cast<const AliPHOSRecoParam*>(AliReconstructor::GetRecoParam(4)); }
 
 private:
   
   static Bool_t fgDebug ; //! verbosity controller
-  static AliPHOSRecoParam  *fgkRecoParamEmc; // reconstruction parameters for EMC
-  static AliPHOSRecoParam  *fgkRecoParamCpv; // reconstruction parameters for EMC
   AliPHOSGeometry          *fGeom;           // pointer to the PHOS geometry
   AliPHOSClusterizerv1     *fClusterizer;    //! PHOS clusterizer
   AliPHOSTrackSegmentMaker *fTSM;            //! PHOS TrackSegmentMaker
@@ -131,7 +115,7 @@ private:
   static TClonesArray      *fgDigitsArray;   //! Array of PHOS digits
   static TObjArray         *fgEMCRecPoints;  //! Array of EMC rec.points
 
-  ClassDef(AliPHOSReconstructor,7)  // PHOS Reconstruction class
+  ClassDef(AliPHOSReconstructor,8)  // PHOS Reconstruction class
 
 }; 
 
index 69a180b2430d67d3faf51b23f06617064967fbf2..adb437f27d306b363e1c3b16a1e6b15322e115f6 100644 (file)
 #pragma link C++ class AliPHOSTrackSegment+;
 
 #pragma link C++ class AliPHOSRecoParam+;
-#pragma link C++ class AliPHOSRecoParamEmc+;
-#pragma link C++ class AliPHOSRecoParamCpv+;
 #pragma link C++ class AliPHOSSimParam+;
 #pragma link C++ class AliPHOSConTableDB+;
 
 #pragma link C++ class AliPHOSImpact+;
 #pragma link C++ class AliPHOSTrigger+;
-#pragma link C++ class AliPHOSCpvRawWrite+;
 
 #endif
index cfe25a1cba3490930b9db07c269eec17697677b9..6b0a6d07faa84d15e516a608da51ed41bef2e08a 100644 (file)
@@ -29,12 +29,9 @@ SRCS          =  \
                  AliPHOSEmcRecPoint.cxx \
                  AliPHOSCpvRecPoint.cxx   AliPHOSTrackSegment.cxx \
                 AliPHOSRecoParam.cxx \
-                AliPHOSRecoParamEmc.cxx \
-                AliPHOSRecoParamCpv.cxx \
                  AliPHOSImpact.cxx \
                  AliPHOSTrigger.cxx \
-                 AliPHOSSimParam.cxx \
-                 AliPHOSCpvRawWrite.cxx
+                 AliPHOSSimParam.cxx
 
 HDRS:= $(SRCS:.cxx=.h) 
 
index d27feb9e3404eb784fc2c0a5f761592ae9048626..a82473a06fd83f1005e26bec4e372405c4c0c09f 100644 (file)
@@ -115,6 +115,54 @@ Float_t AliDAQ::fgkNumberOfLdcs[AliDAQ::kNDetectors] = {
   5
 };
 
+const char* AliDAQ::fgkOfflineModuleName[AliDAQ::kNDetectors] = {
+  "ITS",
+  "ITS",
+  "ITS",
+  "TPC",
+  "TRD",
+  "TOF",
+  "HMPID",
+  "PHOS",
+  "CPV",
+  "PMD",
+  "MUON",
+  "MUON",
+  "FMD",
+  "T0",
+  "VZERO",
+  "ZDC",
+  "ACORDE",
+  "CTP",
+  "EMCAL",
+  "",
+  "HLT"
+};
+
+const char* AliDAQ::fgkOnlineName[AliDAQ::kNDetectors] = {
+  "SPD",
+  "SDD",
+  "SSD",
+  "TPC",
+  "TRD",
+  "TOF",
+  "HMP",
+  "PHS",
+  "CPV",
+  "PMD",
+  "MCH",
+  "MTR",
+  "FMD",
+  "T00",
+  "V00",
+  "ZDC",
+  "ACO",
+  "TRI",
+  "EMC",
+  "TST",
+  "HLT"
+};
+
 AliDAQ::AliDAQ(const AliDAQ& source) :
   TObject(source)
 {
@@ -342,20 +390,21 @@ void AliDAQ::PrintConfig()
 {
   // Print the DAQ configuration
   // for all the detectors
-  printf("====================================================================\n"
-        "|                ALICE Data Acquisition Configuration              |\n"
-        "====================================================================\n"
-        "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs |\n"
-        "====================================================================\n");
+  printf("===================================================================================================\n"
+        "|                              ALICE Data Acquisition Configuration                               |\n"
+        "===================================================================================================\n"
+        "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs | Online Name | AliRoot Module |\n"
+        "===================================================================================================\n");
   for(Int_t iDet = 0; iDet < kNDetectors; iDet++) {
-    printf("|%11d  |%13s  |%10d  |%9d  |%9.1f  |\n",
-          iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet));
+    printf("|%11d  |%13s  |%10d  |%9d  |%9.1f  |%11s  |%14s  |\n",
+          iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet),
+          OnlineName(iDet),OfflineModuleName(iDet));
   }
-  printf("====================================================================\n");
+  printf("===================================================================================================\n");
 
 }
 
-const char *AliDAQ::ListOfTriggeredDetectors(Int_t detectorPattern)
+const char *AliDAQ::ListOfTriggeredDetectors(UInt_t detectorPattern)
 {
   // Returns a string with the list of
   // active detectors. The input is the
@@ -377,3 +426,74 @@ const char *AliDAQ::ListOfTriggeredDetectors(Int_t detectorPattern)
   return detList.Data();
 }
 
+UInt_t  AliDAQ::DetectorPattern(const char *detectorList)
+{
+  // Returns a 32-bit word containing the
+  // the detector pattern corresponding to a given
+  // list of detectors
+  UInt_t pattern = 0;
+  TString detList = detectorList;
+  for(Int_t iDet = 0; iDet < (kNDetectors-1); iDet++) {
+    TString det = fgkDetectorName[iDet];
+    if((detList.CompareTo(det) == 0) || 
+       detList.BeginsWith(det) ||
+       detList.EndsWith(det) ||
+       detList.Contains( " "+det+" " )) pattern |= (1 << iDet) ;
+  }
+
+  // HLT
+  TString hltDet = fgkDetectorName[kNDetectors-1];
+  if((detList.CompareTo(hltDet) == 0) || 
+       detList.BeginsWith(hltDet) ||
+       detList.EndsWith(hltDet) ||
+       detList.Contains( " "+hltDet+" " )) pattern |= (1 << kHLTId) ;
+  
+  return pattern;
+}
+
+const char *AliDAQ::OfflineModuleName(const char *detectorName)
+{
+  // Returns the name of the offline module
+  // for a given detector (online naming convention)
+  Int_t detectorID = DetectorID(detectorName);
+  if (detectorID < 0)
+    return "";
+
+  return OfflineModuleName(detectorID);
+}
+
+const char *AliDAQ::OfflineModuleName(Int_t detectorID)
+{
+  // Returns the name of the offline module
+  // for a given detector (online naming convention)
+  if (detectorID < 0 || detectorID >= kNDetectors) {
+    AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1));
+    return "";
+  }
+
+  return fgkOfflineModuleName[detectorID];
+}
+
+const char *AliDAQ::OnlineName(const char *detectorName)
+{
+  // Returns the name of the online detector name (3 characters)
+  // for a given detector
+  Int_t detectorID = DetectorID(detectorName);
+  if (detectorID < 0)
+    return "";
+
+  return OnlineName(detectorID);
+}
+
+const char *AliDAQ::OnlineName(Int_t detectorID)
+{
+  // Returns the name of the online detector name (3 characters)
+  // for a given detector
+  if (detectorID < 0 || detectorID >= kNDetectors) {
+    AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1));
+    return "";
+  }
+
+  return fgkOnlineName[detectorID];
+}
+
index ca9e98bc8a5645ee426b4f6b97d1e321a7874ddd..1cc0dbd874a4debaa4078c0220ec5182bb8da794 100644 (file)
@@ -58,7 +58,14 @@ class AliDAQ: public TObject {
 
   static void        PrintConfig();
 
-  static const char *ListOfTriggeredDetectors(Int_t detectorPattern);
+  static const char *ListOfTriggeredDetectors(UInt_t detectorPattern);
+  static UInt_t      DetectorPattern(const char *detectorList);
+
+  static const char *OfflineModuleName(const char *detectorName);
+  static const char *OfflineModuleName(Int_t detectorID);
+
+  static const char *OnlineName(const char *detectorName);
+  static const char *OnlineName(Int_t detectorID);
 
   enum {
     kNDetectors = 21,    // Number of detectors
@@ -70,8 +77,10 @@ class AliDAQ: public TObject {
   static const char *fgkDetectorName[kNDetectors]; // Detector names
   static Int_t       fgkNumberOfDdls[kNDetectors]; // Number of DDLs per detector
   static Float_t     fgkNumberOfLdcs[kNDetectors]; // Number of LDCs per detector (not fixed - used only for the raw data simulation)
+  static const char* fgkOfflineModuleName[kNDetectors]; // Names of the offline modules corresponding to the detectors
+  static const char* fgkOnlineName[kNDetectors]; // Online (DAQ/ECS) detector names
 
-  ClassDef(AliDAQ, 2)   // ALICE DAQ Configuration class
+  ClassDef(AliDAQ, 3)   // ALICE DAQ Configuration class
 };
 
 #endif
index 5e005e455a8cc2d71a56707e7e7bc295b6f31aa6..8aa76fd61a2726ca8e4717179a595412bc976a6c 100644 (file)
@@ -127,7 +127,7 @@ void AliCentralTrigger::MakeBranch( TString name, TTree * tree )
       TBranch* branch = tree->GetBranch( name );
       if( branch == 0x0 ) {
          AliDebug( 1, "Creating new branch" );
-         branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l" );
+         branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i" );
          branch->SetAutoDelete( kFALSE );
       }
       else {
@@ -160,7 +160,7 @@ Bool_t AliCentralTrigger::LoadConfiguration( TString & config )
    }
    else {
      // Load one and only one trigger descriptor from CDB
-     AliInfo( "GETTING TRIGGER DESCRIPTORS FROM CDB!!!" );
+     AliInfo( "Getting trigger configuration from OCDB!" );
  
      AliCDBPath path( "GRP", "CTP", "Config" );
        
@@ -299,6 +299,8 @@ ULong64_t AliCentralTrigger::TriggerClasses()
 {
   // Check trigger conditions and create the trigger class
   // and trigger cluster masks
+  fClassMask = 0;
+  fClusterMask = 0;
   if (fConfiguration) {
     const TObjArray& classesArray = fConfiguration->GetClasses();
     Int_t nclasses = classesArray.GetEntriesFast();
@@ -306,8 +308,10 @@ ULong64_t AliCentralTrigger::TriggerClasses()
       AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
       trclass->Trigger( fConfiguration->GetInputs(), fConfiguration->GetFunctions() );
       fClassMask |= trclass->GetValue();
-      if (trclass->GetStatus())
-       fClusterMask |= (trclass->GetCluster())->GetClusterMask();
+      if (trclass->GetStatus()) {
+       AliTriggerCluster *trclust = trclass->GetCluster();
+       fClusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster());
+      }
     }
   }
   return fClassMask;
@@ -379,58 +383,44 @@ Bool_t AliCentralTrigger::IsSelected( TString detName, TString& detectors ) cons
 }
 
 //_____________________________________________________________________________
-TString AliCentralTrigger::GetTriggeredDetectors() const
+Bool_t AliCentralTrigger::CheckTriggeredDetectors() const
 {
   // Check the trigger mask, finds which trigger classes
   // have been fired, load the corresponding trigger clusters and
   // finally makes a list of the detectors that have been readout
-  // for each particular event
+  // for each particular event. This list is then compared to the
+  // one stored in fClusterMask. Return value:
+  // true = two lists are equal
+  // false = two lists are not equal meaning wrong trigger config
+  // is loaded.
 
   if (!fConfiguration) {
-    AliError("The trigger confiration has not yet been loaded!");
-    return "";
-  }
-
-  // Now loop over the trigger classes
-  const TObjArray& classesArray = fConfiguration->GetClasses();
-  Int_t nclasses = classesArray.GetEntriesFast();
-  UChar_t clustMask = 0;
-  for( Int_t j=0; j<nclasses; j++ ) {
-    AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
-    if (trclass->GetMask() & fClassMask) { // class was fired
-      AliTriggerCluster *clust = trclass->GetCluster();
-      clustMask |= clust->GetClusterMask();
-    }
+    AliError("The trigger confiration has not yet been loaded! Cross-check is not possible!");
+    return kFALSE;
   }
+  else {
 
-  // Compare the stored cluster mask with the one
-  // that we get from trigger classes
-  // To be enables after we store the cluster mask in the trigger tree
-  //  if (clustMask != fClusterMask)
-  //    AliError(Form("Wrong cluster mask from trigger classes (%x), expecting (%x)!",(UInt_t)clustMask,(UInt_t)fClusterMask));
-
-  // Now loop over clusters and produce the string
-  // with the triggered detectors
-  TString trigDets;
-  const TObjArray& clustArray = fConfiguration->GetClusters();
-  Int_t nclust = clustArray.GetEntriesFast();
-  for( Int_t i=0; i<nclust; i++ ) {
-    AliTriggerCluster* clust = (AliTriggerCluster*)clustArray.At( i );
-    if (clustMask & clust->GetClusterMask()) { // the cluster was fired
-      TString detStr = clust->GetDetectorsInCluster();
-      TObjArray* det = detStr.Tokenize(" ");
-      Int_t ndet = det->GetEntriesFast();
-      for( Int_t j=0; j<ndet; j++ ) {
-       TString &detj = ((TObjString*)det->At(j))->String();
-         if((trigDets.CompareTo(detj) == 0) || 
-           trigDets.BeginsWith(detj) ||
-           trigDets.EndsWith(detj) ||
-           trigDets.Contains( " "+detj+" " )) continue;
-         trigDets.Append( " " );
-         trigDets.Append( detj );
+    // Make a cross-check so that to exclude wrong trigger configuration used
+    // Loop over the trigger classes
+    UInt_t clusterMask = 0;
+    const TObjArray& classesArray = fConfiguration->GetClasses();
+    Int_t nclasses = classesArray.GetEntriesFast();
+    for( Int_t j=0; j<nclasses; j++ ) {
+      AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
+      if (trclass->GetMask() & fClassMask) { // class was fired
+       AliTriggerCluster *trclust = trclass->GetCluster();
+       clusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster());
       }
     }
+    // Compare the stored cluster mask with the one
+    // that we get from trigger classes
+    // To be enables after we store the cluster mask in the trigger tree
+    if (clusterMask != fClusterMask) {
+      AliError(Form("Wrong cluster mask from trigger classes (%x), expecting (%x)! Loaded trigger configuration is possibly wrong!",
+                   (UInt_t)clusterMask,(UInt_t)fClusterMask));
+      return kFALSE;
+    }
   }
 
-  return trigDets;
+  return kTRUE;
 }
index 351d69d00fa2b0e9012c314b04d2ce04bb2e811c..bd08f573eebc71c1bb345711fdd365ad9d7cb126 100644 (file)
@@ -45,14 +45,19 @@ public:
   //  Getters
                TString    GetDetectors();
              ULong64_t    GetClassMask() const { return fClassMask; }
-              UChar_t    GetClusterMask() const { return fClusterMask; }
+               UInt_t    GetClusterMask() const { return fClusterMask; }
  AliTriggerConfiguration* GetConfiguration() { return fConfiguration; }
              TObjArray*   GetFiredClasses() const;
                   void    Print( const Option_t* opt ="" ) const;
-              TString    GetTriggeredDetectors() const;
+               Bool_t    CheckTriggeredDetectors() const;
+
+              // Setters to be used in case raw data when the trigger information
+              // is read from the event header
+              void       SetClassMask(ULong64_t mask) { fClassMask = mask; }
+              void       SetClusterMask(UInt_t mask)  { fClusterMask = mask; }
 protected:
              ULong64_t    fClassMask;          // UID ( bitwise OR of conditions mask )
-               UChar_t    fClusterMask;        // UID ( bitwise OR of clusters mask )
+                UInt_t    fClusterMask;        // UID ( bitwise OR of clusters mask - detector pattern)
  AliTriggerConfiguration* fConfiguration;      // Trigger Configuration used
 
 private:
@@ -62,7 +67,7 @@ private:
                AliCentralTrigger( const AliCentralTrigger& ctp ); // Implemented
                AliCentralTrigger& operator=( const AliCentralTrigger& ctp ); // Not implemented
 
-   ClassDef( AliCentralTrigger, 3 )  // class for running the Central Trigger Processor
+   ClassDef( AliCentralTrigger, 5 )  // class for running the Central Trigger Processor
 };
 
 
index 3acfae6d8db03d3cb9d1d1b243916a6cd88d25b5..a64fe79e87c44d865503a06caac8298e973793da 100644 (file)
@@ -20,7 +20,8 @@
 // Base Class for detector Reconstruction Parameters                         //
 //                                                                           //  
 // 
-// AliDetectorRecoParam are identified according name   
+// AliDetectorRecoParam are identified according fEventSpecie - event specie(s)
+// for which the object is valid.  
 // The owner of the AliDetectorRecoParam is the AliRecoParam
 // More than one RecoParam per recon can be registered.
 //          
@@ -35,7 +36,8 @@ ClassImp(AliDetectorRecoParam)
 
 
 AliDetectorRecoParam::AliDetectorRecoParam():
-    TNamed()
+  TNamed(),
+  fEventSpecie(0)
 {
   //
   // default constructor
@@ -44,7 +46,7 @@ AliDetectorRecoParam::AliDetectorRecoParam():
 
 AliDetectorRecoParam::~AliDetectorRecoParam(){
   //
-  // default destructor
+  // destructor
   //
 }
 
index 1ac3fb2d22ce71ff1a828ad9c5b2018539114bc3..67df07a527a5223e64672c8a8155b69f9fc1262a 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "TNamed.h"
 
+#include "AliRecoParam.h"
+
 class AliDetectorRecoParam : public TNamed
 {
   
@@ -20,10 +22,16 @@ class AliDetectorRecoParam : public TNamed
   virtual ~AliDetectorRecoParam();
   void  Print(Option_t */*option*/) const {Dump();}
 
-protected:
+  Int_t          GetEventSpecie() const { return fEventSpecie; }
+  void           SetEventSpecie(Int_t specie) { fEventSpecie = specie; }
+  void           SetAsDefault() { fEventSpecie |= AliRecoParam::kDefault; }
+  Bool_t         IsDefault() const { return (fEventSpecie & AliRecoParam::kDefault); }
+
+private:
 
+  Int_t  fEventSpecie; // Event specie for which the reco-param object is valid
   
-  ClassDef(AliDetectorRecoParam, 2)
+  ClassDef(AliDetectorRecoParam, 3)
 };
 
 
index ab183f4838a518858b2e9627c89eb764150bba61..6f2417722d60c397673a29ad396bc3f99040e496 100644 (file)
 
 //////////////////////////////////////////////////////////////////////////////
 //                          Class AliEventInfo                              //
-//   Container class for all the information related to LHCstate, run and   //
-//   event types, trigger mask and trigger clusters.                        //
-//   It is used in order to provide the detector's AliRecoParam objects with//
-//   the necessary information so that they can decide which instance of    //
-//   AliDetectorRecoParam to use in reconstruction one particular event.    //
+//   Container class for all the information related to                     //
+//   event type, trigger mask and trigger clusters.                         //
+//   It is used together with AliRunInfo in order to provide the detector's //
+//   AliRecoParam object with                                               //
+//   the necessary information so that it can decide which instance of      //
+//   AliDetectorRecoParam objects to use in reconstruction one particular   //
+//   event.                                                                 //
 //                                                                          //
 //   cvetan.cheshkov@cern.ch 12/06/2008                                     //
 //////////////////////////////////////////////////////////////////////////////
@@ -31,10 +33,6 @@ ClassImp(AliEventInfo)
 //______________________________________________________________________________
 AliEventInfo::AliEventInfo():
   TObject(),
-  fLHCState("UNKNOWN"),
-  fBeamType("UNKNOWN"),
-  fRunType("UNKNOWN"),
-  fActiveDetectors(""),
   fEventType(0),
   fTriggerClasses(""),
   fTriggerMask(0),
@@ -46,17 +44,17 @@ AliEventInfo::AliEventInfo():
 }
 
 //______________________________________________________________________________
-AliEventInfo::AliEventInfo(const char *lhcState, const char *beamType, const char *runType, const char *activeDetectors):
+AliEventInfo::AliEventInfo(UInt_t evType,
+                          const char *classes,
+                          ULong64_t mask,
+                          const char *cluster,
+                          const char *decision):
   TObject(),
-  fLHCState(lhcState),
-  fBeamType(beamType),
-  fRunType(runType),
-  fActiveDetectors(activeDetectors),  
-  fEventType(0),
-  fTriggerClasses(""),
-  fTriggerMask(0),
-  fTriggerCluster(""),
-  fHLTDecision("")
+  fEventType(evType),
+  fTriggerClasses(classes),
+  fTriggerMask(mask),
+  fTriggerCluster(cluster),
+  fHLTDecision(decision)
 {
   // constructor
   // ...
@@ -65,10 +63,6 @@ AliEventInfo::AliEventInfo(const char *lhcState, const char *beamType, const cha
 //______________________________________________________________________________
 AliEventInfo::AliEventInfo(const AliEventInfo &evInfo):
   TObject(evInfo),
-  fLHCState(evInfo.fLHCState),
-  fBeamType(evInfo.fBeamType),
-  fRunType(evInfo.fRunType),
-  fActiveDetectors(evInfo.fActiveDetectors),
   fEventType(evInfo.fEventType),
   fTriggerClasses(evInfo.fTriggerClasses),
   fTriggerMask(evInfo.fTriggerMask),
@@ -87,10 +81,6 @@ AliEventInfo &AliEventInfo::operator =(const AliEventInfo& evInfo)
   if(this==&evInfo) return *this;
   ((TObject *)this)->operator=(evInfo);
 
-  fLHCState = evInfo.fLHCState;
-  fBeamType = evInfo.fBeamType;
-  fRunType = evInfo.fRunType;
-  fActiveDetectors = evInfo.fActiveDetectors;
   fEventType = evInfo.fEventType;
   fTriggerClasses = evInfo.fTriggerClasses;
   fTriggerMask = evInfo.fTriggerMask; 
@@ -105,10 +95,6 @@ void AliEventInfo::Reset()
 {
   // Reset the contents
   // ...
-//   fLHCState = "UNKNOWN";
-//   fRunType = "UNKNOWN";
-//   fBeamType = "UNKNOWN";
-//   fActiveDetectors = "";
   fEventType = 0;
   fTriggerClasses = "";
   fTriggerMask = 0;
index eba158f2f57e4b75415f77551138b815072d22f4..5ce4f1ab489185ae6d78285a51d144006bbc895c 100644 (file)
@@ -5,11 +5,13 @@
 
 //////////////////////////////////////////////////////////////////////////////
 //                          Class AliEventInfo                              //
-//   Container class for all the information related to LHCstate, run and   //
-//   event types, trigger mask and trigger clusters.                        //
-//   It is used in order to provide the detector's AliRecoParam objects with//
-//   the necessary information so that they can decide which instance of    //
-//   AliDetectorRecoParam to use in reconstruction one particular event.    //
+//   Container class for all the information related to                     //
+//   event type, trigger mask and trigger clusters.                         //
+//   It is used together with AliRunInfo in order to provide the detector's //
+//   AliRecoParam object with                                               //
+//   the necessary information so that it can decide which instance of      //
+//   AliDetectorRecoParam objects to use in reconstruction one particular   //
+//   event.                                                                 //
 //                                                                          //
 //   cvetan.cheshkov@cern.ch 12/06/2008                                     //
 //////////////////////////////////////////////////////////////////////////////
@@ -21,47 +23,41 @@ class AliEventInfo : public TObject {
 
  public:
   AliEventInfo();
-  AliEventInfo(const char *lhcState,
-              const char *beamType,
-              const char *runType,
-              const char *activeDetectors);
+  AliEventInfo(UInt_t evType,
+              const char *classes,
+              ULong64_t mask,
+              const char *cluster,
+              const char *decision);
   virtual ~AliEventInfo() {}
 
   void SetEventType(UInt_t evType) { fEventType = evType; }
-  void SetTriggerClasses(const char *classes) { fTriggerClasses.SetString(classes); }
+  void SetTriggerClasses(const char *classes) { fTriggerClasses = classes; }
   void SetTriggerMask(ULong64_t mask) { fTriggerMask = mask; }
-  void SetTriggerCluster(const char *cluster) { fTriggerCluster.SetString(cluster); }
-  void SetHLTDecision(const char *decision) { fHLTDecision.SetString(decision); }
+  void SetTriggerCluster(const char *cluster) { fTriggerCluster = cluster; }
+  void SetHLTDecision(const char *decision) { fHLTDecision = decision; }
 
   virtual void Print(Option_t */*option=""*/) const { Dump(); }
 
-  const char *GetLHCState() const { return fLHCState.GetString().Data(); }
-  const char *GetBeamType() const { return fBeamType.GetString().Data(); }
-  const char *GetRunType() const { return fRunType.GetString().Data(); }
-  const char *GetActiveDetectors() const { return fActiveDetectors.GetString().Data(); }
   UInt_t      GetEventType() const { return fEventType; }
-  const char *GetTriggerClasses() const { return fTriggerClasses.GetString().Data(); }
+  const char *GetTriggerClasses() const { return fTriggerClasses.Data(); }
   ULong64_t   GetTriggerMask() const { return fTriggerMask; }
-  const char *GetTriggerCluster() const { return fTriggerCluster.GetString().Data(); }
-  const char *GetHLTDecision() const { return fHLTDecision.GetString().Data(); }
+  const char *GetTriggerCluster() const { return fTriggerCluster.Data(); }
+  const char *GetHLTDecision() const { return fHLTDecision.Data(); }
 
   AliEventInfo(const AliEventInfo &evInfo);
   AliEventInfo& operator= (const AliEventInfo& evInfo);
 
   void Reset();
+
  private:
 
-  TObjString  fLHCState;       // state of the machine as provided by DCS and DAQ log-book (per run)
-  TObjString  fBeamType;       // beam type for Alice
-  TObjString  fRunType;        // run type accoring to ECS (per run)
-  TObjString  fActiveDetectors;// list of active detectors (per run)
   UInt_t      fEventType;      // event type as defined by DAQ (start_of_*,calibration,physics etc) (per event)
-  TObjString  fTriggerClasses; // list of fired trigger classes (per event)
+  TString     fTriggerClasses; // list of fired trigger classes (per event)
   ULong64_t   fTriggerMask;    // trigger mask as received from DAQ or CTP raw-data payload (per event)
-  TObjString  fTriggerCluster; // list of detectors that have been read out (per event)
-  TObjString  fHLTDecision;    // string describing the HLT decision (per event)
+  TString     fTriggerCluster; // list of detectors that have been read out (per event)
+  TString     fHLTDecision;    // string describing the HLT decision (per event)
 
-  ClassDef(AliEventInfo,2)     // Event info class
+  ClassDef(AliEventInfo,3)     // Event info class
 };
 
 #endif
index c93a07e435b8ac6ca66db279dc2b72ef8b0f718d..9f16b838dc2309ab24ddbfed22c13642f8e6f8ef 100644 (file)
@@ -24,7 +24,7 @@
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
-#include "AliEventInfo.h"
+#include "AliRunInfo.h"
 #include "AliLog.h"
 #include "AliModule.h" 
 #include "AliQA.h"
@@ -48,8 +48,8 @@ ClassImp(AliQAChecker)
 AliQAChecker::AliQAChecker(const char* name, const char* title) :
   TNamed(name, title),
   fDataFile(0x0), 
-  fEventInfo(0x0), 
-  fEventInfoOwner(kFALSE), 
+  fRunInfo(0x0), 
+  fRunInfoOwner(kFALSE), 
   fRefFile(0x0), 
   fFoundDetectors(".")
 {
@@ -62,8 +62,8 @@ AliQAChecker::AliQAChecker(const char* name, const char* title) :
 AliQAChecker::AliQAChecker(const AliQAChecker& qac) :
   TNamed(qac),
   fDataFile(qac.fDataFile), 
-  fEventInfo(qac.fEventInfo), 
-  fEventInfoOwner(kFALSE),   
+  fRunInfo(qac.fRunInfo), 
+  fRunInfoOwner(kFALSE),   
   fRefFile(qac.fRefFile), 
   fFoundDetectors(qac.fFoundDetectors)
 {
@@ -87,8 +87,8 @@ AliQAChecker& AliQAChecker::operator = (const AliQAChecker& qac)
 AliQAChecker::~AliQAChecker()
 {
 // clean up
-  if (fEventInfo)
-    delete fEventInfo ; 
+  if (fRunInfo)
+    delete fRunInfo ; 
   delete [] fCheckers ; 
   AliQA::Close() ; 
 }
@@ -162,10 +162,10 @@ void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory
   } else if (refStorage.Contains(AliQA::GetLabLocalOCDB()) || refStorage.Contains(AliQA::GetLabAliEnOCDB())) { 
     AliCDBManager* man = AliCDBManager::Instance() ;
     if ( strcmp(AliQA::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (RUNTYPE)
-      // Get it from EventInfo
-      if (!fEventInfo)  // not yet set, get the info from GRP
-                               LoadEventInfoFromGRP() ; 
-      AliQA::SetQARefDataDirName(fEventInfo->GetRunType()) ;
+      // Get it from RunInfo
+      if (!fRunInfo)  // not yet set, get the info from GRP
+                               LoadRunInfoFromGRP() ; 
+      AliQA::SetQARefDataDirName(fRunInfo->GetRunType()) ;
     }
     if ( ! man->GetLock() ) { 
       man->SetDefaultStorage(AliQA::GetQARefStorage()) ; 
@@ -192,7 +192,7 @@ AliQAChecker * AliQAChecker::Instance()
 }
 
 //_____________________________________________________________________________
-void AliQAChecker::LoadEventInfoFromGRP() 
+void AliQAChecker::LoadRunInfoFromGRP() 
 {
   AliCDBManager* man = AliCDBManager::Instance() ;
   AliCDBEntry* entry = man->Get(AliQA::GetGRPPath().Data());
@@ -212,6 +212,11 @@ void AliQAChecker::LoadEventInfoFromGRP()
   if (!beamType) {
     AliWarning(Form("%s entry:  missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data()));
   }
+  TObjString *beamEnergyStr=
+    dynamic_cast<TObjString*>(data->GetValue("fAliceBeamEnergy"));
+  if (!beamEnergyStr) {
+    AliWarning(Form("%s entry:  missing value for the beam energy ! Using 0", AliQA::GetGRPPath().Data()));
+  }
   TObjString *runType=
     dynamic_cast<TObjString*>(data->GetValue("fRunType"));
   if (!runType) {
@@ -219,13 +224,14 @@ void AliQAChecker::LoadEventInfoFromGRP()
   TObjString *activeDetectors=
     dynamic_cast<TObjString*>(data->GetValue("fDetectorMask"));
   if (!activeDetectors) {
-    AliWarning(Form("%s entry:  missing value for the detector mask ! Using ALL", AliQA::GetGRPPath().Data()));  
+    AliWarning(Form("%s entry:  missing value for the detector mask ! Using 1074790399", AliQA::GetGRPPath().Data()));  
   }
-  fEventInfo = new AliEventInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN",
-                               beamType ? beamType->GetString().Data() : "UNKNOWN",
-                               runType  ? runType->GetString().Data()  : "UNKNOWN",
-                               activeDetectors ? activeDetectors->GetString().Data() : "ALL");
-  fEventInfoOwner = kTRUE ; 
+  fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN",
+                           beamType ? beamType->GetString().Data() : "UNKNOWN",
+                           beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0,
+                           runType  ? runType->GetString().Data()  : "UNKNOWN",
+                           activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399);
+  fRunInfoOwner = kTRUE ; 
 }
 
 //_____________________________________________________________________________
index 7dbb64933b34128a5b74ef69d7da938bad11a7b9..dfa9351bb8daefb593ffa50d15ef6da5587a89fd 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "AliQA.h"
 class AliCDBEntry ; 
-class AliEventInfo ;
+class AliRunInfo ;
 class AliQACheckerBase ; 
 
 class AliQAChecker: public TNamed {
@@ -40,16 +40,16 @@ public:
 
   virtual Bool_t Run(const char * fileName = NULL) ;
   virtual Bool_t Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObjArray * list);
-  void SetEventInfo(AliEventInfo * ei) {fEventInfo = ei;}
+  void SetRunInfo(AliRunInfo * ei) {fRunInfo = ei;}
 
 private:
 
-  void LoadEventInfoFromGRP() ; 
+  void LoadRunInfoFromGRP() ; 
 
   static AliQAChecker *fgQAChecker ;             // pointer to the instance of the singleton
   TFile *              fDataFile ;               //! Data file to check
-  AliEventInfo *       fEventInfo ;              //! Event info object 
-  Bool_t               fEventInfoOwner;          //! owns fEventInfo or not
+  AliRunInfo *       fRunInfo ;              //! Event info object 
+  Bool_t               fRunInfoOwner;          //! owns fRunInfo or not
   TFile *              fRefFile ;                //! Reference Data file 
   TString              fFoundDetectors ;         //! detectors for which the Quality assurance could be done
   AliQACheckerBase *   fCheckers[AliQA::kNDET] ; //! list of detectors checkers
index ad5838b2c05a32d5b5209edf3ec499b6ae01deac..1dc9e3f2b53ecbed2e68fb643dbe7301ea124642 100644 (file)
 #include "AliLog.h"
 #include "AliRecoParam.h"
 
-
 ClassImp(AliRecoParam)
 
 AliRecoParam::AliRecoParam(): 
-  TNamed("",""),
-  fRecoParamArray(0)
-{
-  // Default constructor
-  // ...
-}
-
-AliRecoParam::AliRecoParam(const char *detector): 
-  TNamed(detector,detector),
-  fRecoParamArray(0)
+  TObject(),
+  fEventSpecie(kDefault)
 {
   // Default constructor
   // ...
+  for(Int_t iDet = 0; iDet < kNDetectors; iDet++)
+    fDetRecoParams[iDet] = NULL;
+  for(Int_t iSpecie = 0; iSpecie < kNSpecies; iSpecie++) {
+    for(Int_t iDet = 0; iDet < kNDetectors; iDet++) {
+      fDetRecoParamsIndex[iSpecie][iDet] = -1;
+    }
+  }
 }
 
 AliRecoParam::~AliRecoParam(){
   // Destructor
   // ...
   // Delete the array with the reco-param objects
-  if (fRecoParamArray){
-    fRecoParamArray->Delete();
-    delete fRecoParamArray;
+  for(Int_t iDet = 0; iDet < kNDetectors; iDet++) {
+    if (fDetRecoParams[iDet]){
+      fDetRecoParams[iDet]->Delete();
+      delete fDetRecoParams[iDet];
+    }
   }
 }
 
@@ -64,30 +64,81 @@ void  AliRecoParam::Print(Option_t *option) const {
   //
   // Print reconstruction setup
   //
-  printf("AliRecoParam object for %s\n",GetName()); 
-  if (!fRecoParamArray) return;
-  Int_t nparam = fRecoParamArray->GetEntriesFast();
-  for (Int_t iparam=0; iparam<nparam; iparam++){
-    AliDetectorRecoParam * param = (AliDetectorRecoParam *)fRecoParamArray->At(iparam);
-    if (!param) continue;
-    param->Print(option);
+  for(Int_t iDet = 0; iDet < kNDetectors; iDet++) {
+    if (fDetRecoParams[iDet]){
+      printf("AliDetectorRecoParam objects for detector %d\n",iDet); 
+      Int_t nparam = fDetRecoParams[iDet]->GetEntriesFast();
+      for (Int_t iparam=0; iparam<nparam; iparam++){
+       AliDetectorRecoParam * param = (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(iparam);
+       if (!param) continue;
+       param->Print(option);
+      }
+    }
+    else {
+      printf("No AliDetectorRecoParam objects specified for detector %d\n",iDet); 
+    }
   }
 }
 
-AliDetectorRecoParam *AliRecoParam::GetRecoParam(const AliEventInfo &/*evInfo*/) const {
-  // To be implemented by the detectors
-  // Here we return the last AliDetectorRecoParam!!
-  if (!fRecoParamArray) return NULL;
-  if (fRecoParamArray->GetEntriesFast() != 1)
-    AliWarning(Form("Method not implemented by the detector %s, using the last AliDetectorRecoParam !",GetName()));
+void AliRecoParam::SetEventSpecie(const AliRunInfo */*runInfo*/, const AliEventInfo &/*evInfo*/)
+{
+  // To be implemented
+  // Here we return always kDefault!!
+  fEventSpecie = kDefault;
+}
+
+const AliDetectorRecoParam *AliRecoParam::GetDetRecoParam(Int_t iDet) const
+{
+  // Return AliDetectorRecoParam object for a given detector
+  // according to the event specie provided as an argument
+  if (!fDetRecoParams[iDet]) return NULL;
+  if (fDetRecoParams[iDet]->GetEntries() == 0) return NULL;
+
+  for(Int_t iBit = 0; iBit < kNSpecies; iBit++) {
+    if (fEventSpecie & (1 << iBit)) {
+      if (fDetRecoParamsIndex[iBit][iDet] >= 0)
+       return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[iBit][iDet]);
+      else
+       return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[0][iDet]);
+    }
+  }
 
-  return (AliDetectorRecoParam *)fRecoParamArray->Last();
+  // Default one
+  AliError(Form("Invalid event specie: %d!",fEventSpecie));
+  return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[0][iDet]);
 }
 
-void  AliRecoParam::AddRecoParam(AliDetectorRecoParam* param){
+void  AliRecoParam::AddDetRecoParam(Int_t iDet, AliDetectorRecoParam* param)
+{
   // Add an instance of reco params object into
-  // the fRecoParamArray
-  //
-  if (!fRecoParamArray) fRecoParamArray = new TObjArray;
-  fRecoParamArray->AddLast(param);
+  // the fDetRecoParams for detector iDet
+  // Updates the fDetRecoParams index
+  if (!fDetRecoParams[iDet]) fDetRecoParams[iDet] = new TObjArray;
+  fDetRecoParams[iDet]->AddLast(param);
+  Int_t index = fDetRecoParams[iDet]->GetLast();
+
+  // Index
+  Int_t specie = param->GetEventSpecie();
+  for(Int_t iBit = 0; iBit < kNSpecies; iBit++) {
+    if (specie & (1 << iBit)) {
+      fDetRecoParamsIndex[iBit][iDet] = index;
+    }
+  }
+}
+
+Bool_t AliRecoParam::AddDetRecoParamArray(Int_t iDet, TObjArray* parArray)
+{
+  // Add an array of reconstruction parameter objects
+  // for a given detector
+  // Basic check on the consistency of the array
+  Bool_t defaultFound = kFALSE;
+  for(Int_t i = 0; i < parArray->GetEntriesFast(); i++) {
+    AliDetectorRecoParam *par = (AliDetectorRecoParam*)parArray->At(i);
+    if (!par) continue;
+    if (par->IsDefault()) defaultFound = kTRUE;
+  }
+   
+  fDetRecoParams[iDet] = parArray;
+
+  return defaultFound;
 }
index 7ab4142b962079058f74c8930aaa2378d9a2c01e..d5dd6e96e99338fe021b0966af704db95b7020d3 100644 (file)
@@ -5,40 +5,55 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// Base Class for Detector reconstruction parameters                         //
+// Steering Class for reconstruction parameters                              //
 // Revision: cvetan.cheshkov@cern.ch 12/06/2008                              //
-// Its structure has been revised and it is interfaced to AliEventInfo.      //
+// Its structure has been revised and it is interfaced to AliRunInfo and     //
+// AliEventInfo.                                                             //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
 
-#include "TNamed.h"
+#include "TObject.h"
+
 class AliDetectorRecoParam;
+class AliRunInfo;
 class AliEventInfo;
 
-class AliRecoParam : public TNamed
+class AliRecoParam : public TObject
 {
 
  public: 
   AliRecoParam();
-  AliRecoParam(const char *detector);
   virtual ~AliRecoParam();  
   //
-  virtual void                  Print(Option_t *option="") const;
-  TObjArray                    *GetAllRecoParams() const { return fRecoParamArray; }
-  virtual AliDetectorRecoParam *GetRecoParam(const AliEventInfo &/*evInfo*/) const;
-  void                          AddRecoParam(AliDetectorRecoParam* param);
-
-protected:
+  enum {
+    kNSpecies = 5,   // number of event species
+    kNDetectors = 15 // number of detectors
+  };
+  enum EventSpecie_t {kDefault = 1,
+                     kLowMult = 2,
+                     kHighMult = 4,
+                     kCosmic = 8,
+                     kCalib = 16};
 
-  TObjArray *fRecoParamArray;   //array with reconstruction-parameter objects
+  virtual void                  Print(Option_t *option="") const;
+  const TObjArray              *GetDetRecoParamArray(Int_t iDet) const { return fDetRecoParams[iDet]; }
+  void                          SetEventSpecie(const AliRunInfo*/*runInfo*/, const AliEventInfo &/*evInfo*/);
+  EventSpecie_t                 GetEventSpecie() const { return fEventSpecie; }
+  const AliDetectorRecoParam   *GetDetRecoParam(Int_t iDet) const;
+  void                          AddDetRecoParam(Int_t iDet, AliDetectorRecoParam* param);
+  Bool_t                        AddDetRecoParamArray(Int_t iDet, TObjArray* parArray);
 
 private:
 
   AliRecoParam(const AliRecoParam&); // Not implemented
   AliRecoParam& operator=(const AliRecoParam&); // Not implemented
 
-  ClassDef(AliRecoParam, 2)
+  Int_t      fDetRecoParamsIndex[kNSpecies][kNDetectors]; //!index to fDetRecoParams arrays
+  TObjArray *fDetRecoParams[kNDetectors];   //!array with reconstruction-parameter objects for all detectors
+  EventSpecie_t fEventSpecie;               //!current event specie
+
+  ClassDef(AliRecoParam, 3)
 };
 
 
index 6f4462e4025d80111cee4e1c89fe905052b0355e..5bf42d43bb78941acd2d4ec6c4c46ab13df74d2b 100644 (file)
 
 #include "AliMagWrapCheb.h"
 
+#include "AliDetectorRecoParam.h"
+#include "AliRunInfo.h"
+#include "AliEventInfo.h"
+
+#include "AliDAQ.h"
+
 ClassImp(AliReconstruction)
 
 
@@ -237,11 +243,15 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename,
   fLoadAlignData("ALL"),
   fESDPar(""),
   fUseHLTData(),
+  fRunInfo(NULL),
+  fEventInfo(),
 
   fRunLoader(NULL),
   fRawReader(NULL),
   fParentRawReader(NULL),
 
+  fRecoParam(),
+
   fVertexer(NULL),
   fDiamondProfile(NULL),
   fDiamondProfileTPC(NULL),
@@ -329,11 +339,15 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) :
   fLoadAlignData(rec.fLoadAlignData),
   fESDPar(rec.fESDPar),
   fUseHLTData(rec.fUseHLTData),
+  fRunInfo(NULL),
+  fEventInfo(),
 
   fRunLoader(NULL),
   fRawReader(NULL),
   fParentRawReader(NULL),
 
+  fRecoParam(),
+
   fVertexer(NULL),
   fDiamondProfile(NULL),
   fDiamondProfileTPC(NULL),
@@ -647,6 +661,21 @@ void AliReconstruction::SetOption(const char* detector, const char* option)
   fOptions.Add(new TNamed(detector, option));
 }
 
+//_____________________________________________________________________________
+void AliReconstruction::SetRecoParam(const char* detector, AliDetectorRecoParam *par)
+{
+  // Set custom reconstruction parameters for a given detector
+  // Single set of parameters for all the events
+  for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+    if(!strcmp(detector, fgkDetectorName[iDet])) {
+      par->SetAsDefault();
+      fRecoParam.AddDetRecoParam(iDet,par);
+      break;
+    }
+  }
+
+}
+
 //_____________________________________________________________________________
 Bool_t AliReconstruction::SetFieldMap(Float_t l3Current, Float_t diCurrent, Float_t factor, const char *path) {
   //------------------------------------------------
@@ -726,6 +755,55 @@ Bool_t AliReconstruction::InitGRP() {
      return kFALSE;
   }
 
+  TObjString *lhcState=
+    dynamic_cast<TObjString*>(fGRPData->GetValue("fLHCState"));
+  if (!lhcState) {
+    AliError("GRP/GRP/Data entry:  missing value for the LHC state ! Using UNKNOWN");
+  }
+
+  TObjString *beamType=
+    dynamic_cast<TObjString*>(fGRPData->GetValue("fAliceBeamType"));
+  if (!beamType) {
+    AliError("GRP/GRP/Data entry:  missing value for the beam type ! Using UNKNOWN");
+  }
+
+  TObjString *beamEnergyStr=
+    dynamic_cast<TObjString*>(fGRPData->GetValue("fAliceBeamEnergy"));
+  if (!beamEnergyStr) {
+    AliError("GRP/GRP/Data entry:  missing value for the beam energy ! Using 0");
+  }
+
+  TObjString *runType=
+    dynamic_cast<TObjString*>(fGRPData->GetValue("fRunType"));
+  if (!runType) {
+    AliError("GRP/GRP/Data entry:  missing value for the run type ! Using UNKNOWN");
+  }
+
+  TObjString *activeDetectors=
+    dynamic_cast<TObjString*>(fGRPData->GetValue("fDetectorMask"));
+  if (!activeDetectors) {
+    AliError("GRP/GRP/Data entry:  missing value for the detector mask ! Using 1074790399");
+  }
+
+  fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN",
+                           beamType ? beamType->GetString().Data() : "UNKNOWN",
+                           beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0,
+                           runType  ? runType->GetString().Data()  : "UNKNOWN",
+                           activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399);
+
+  // Process the list of active detectors
+  if (activeDetectors && activeDetectors->GetString().IsDigit()) {
+    UInt_t detMask = activeDetectors->GetString().Atoi();
+    fRunLocalReconstruction = MatchDetectorList(fRunLocalReconstruction,detMask);
+    fRunTracking = MatchDetectorList(fRunTracking,detMask);
+    fFillESD = MatchDetectorList(fFillESD,detMask);
+  }
+
+  AliInfo("===================================================================================");
+  AliInfo(Form("Running local reconstruction for detectors: %s",fRunLocalReconstruction.Data()));
+  AliInfo(Form("Running tracking for detectors: %s",fRunTracking.Data()));
+  AliInfo(Form("Filling ESD for detectors: %s",fFillESD.Data()));
+  AliInfo("===================================================================================");
 
   //*** Dealing with the magnetic field map
   if (AliTracker::GetFieldMap()) {
@@ -888,6 +966,14 @@ Bool_t AliReconstruction::InitRun(const char* input)
 
   if (!InitGRP()) return kFALSE;
 
+  // Read the reconstruction parameters from OCDB
+  if (!InitRecoParams()) {
+    if (fStopOnError) {
+      CleanUp(); 
+      return kFALSE;
+    }
+  }
+   AliSysInfo::AddStamp("ReadRecoParam");
 
   ftVertexer = new AliVertexerTracks(AliTracker::GetBz());
   if(fDiamondProfile && fMeanVertexConstraint) ftVertexer->SetVtxStart(fDiamondProfile);
@@ -1057,6 +1143,10 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent)
 
   AliInfo(Form("processing event %d", iEvent));
 
+  // Fill Event-info object
+  GetEventInfo();
+  fRecoParam.SetEventSpecie(fRunInfo,fEventInfo);
+
     //Start of cycle for the in-loop QA
     if (fInLoopQA) {
        if (fRunQA) {
@@ -1374,6 +1464,12 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent)
         }
      }
 
+     fEventInfo.Reset();
+     for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+       if (fReconstructor[iDet])
+        fReconstructor[iDet]->SetRecoParam(NULL);
+     }
+
      return kTRUE;
 }
 
@@ -2043,66 +2139,27 @@ Bool_t AliReconstruction::FillTriggerESD(AliESDEvent*& esd)
   
   AliInfo("Filling trigger information into the ESD");
 
-  AliCentralTrigger *aCTP = NULL;
-
   if (fRawReader) {
     AliCTPRawStream input(fRawReader);
     if (!input.Next()) {
-      AliWarning("No valid CTP (trigger) DDL raw data is found ! The trigger mask will be taken from the event header, trigger cluster mask will be empty !");
-      ULong64_t mask = (((ULong64_t)fRawReader->GetTriggerPattern()[1]) << 32) +
-       fRawReader->GetTriggerPattern()[0];
-      esd->SetTriggerMask(mask);
-      esd->SetTriggerCluster(0);
-    }
-    else {
-      esd->SetTriggerMask(input.GetClassMask());
-      esd->SetTriggerCluster(input.GetClusterMask());
-    }
-
-    aCTP = new AliCentralTrigger();
-    TString configstr("");
-    if (!aCTP->LoadConfiguration(configstr)) { // Load CTP config from OCDB
-      AliError("No trigger configuration found in OCDB! The trigger classes information will no be stored in ESD!");
-      delete aCTP;
-      return kFALSE;
-    }
-  }
-  else {
-    AliRunLoader *runloader = AliRunLoader::GetRunLoader();
-    if (runloader) {
-      if (!runloader->LoadTrigger()) {
-       aCTP = runloader->GetTrigger();
-       esd->SetTriggerMask(aCTP->GetClassMask());
-       esd->SetTriggerCluster(aCTP->GetClusterMask());
-      }
-      else {
-       AliWarning("No trigger can be loaded! The trigger information is not stored in the ESD !");
-       return kFALSE;
-      }
+      AliWarning("No valid CTP (trigger) DDL raw data is found ! The trigger info is taken from the event header!");
     }
     else {
-      AliError("No run loader is available! The trigger information is not stored in the ESD !");
-      return kFALSE;
+      if (esd->GetTriggerMask() != input.GetClassMask())
+       AliError(Form("Invalid trigger pattern found in CTP raw-data: %llx %llx",
+                     input.GetClassMask(),esd->GetTriggerMask()));
+      if (esd->GetOrbitNumber() != input.GetOrbitID())
+       AliError(Form("Invalid orbit id found in CTP raw-data: %x %x",
+                     input.GetOrbitID(),esd->GetOrbitNumber()));
+      if (esd->GetBunchCrossNumber() != input.GetBCID())
+       AliError(Form("Invalid bunch-crossing id found in CTP raw-data: %x %x",
+                     input.GetBCID(),esd->GetBunchCrossNumber()));
     }
-  }
-
-  // Now fill the trigger class names into AliESDRun object
-  AliTriggerConfiguration *config = aCTP->GetConfiguration();
-  if (!config) {
-    AliError("No trigger configuration has been found! The trigger classes information will not be stored in ESD!");
-    if (fRawReader) delete aCTP;
-    return kFALSE;
-  }
 
-  const TObjArray& classesArray = config->GetClasses();
-  Int_t nclasses = classesArray.GetEntriesFast();
-  for( Int_t j=0; j<nclasses; j++ ) {
-    AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j );
-    Int_t trindex = (Int_t)TMath::Log2(trclass->GetMask());
-    esd->SetTriggerClass(trclass->GetName(),trindex);
+  // Here one has to add the filling of trigger inputs and
+  // interaction records
+  // ...
   }
-
-  if (fRawReader) delete aCTP;
   return kTRUE;
 }
 
@@ -2229,7 +2286,13 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet)
 {
 // get the reconstructor object and the loader for a detector
 
-  if (fReconstructor[iDet]) return fReconstructor[iDet];
+  if (fReconstructor[iDet]) {
+    if (fRecoParam.GetDetRecoParamArray(iDet) && !AliReconstructor::GetRecoParam(iDet)) {
+      const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
+      fReconstructor[iDet]->SetRecoParam(par);
+    }
+    return fReconstructor[iDet];
+  }
 
   // load the reconstructor object
   TPluginManager* pluginManager = gROOT->GetPluginManager();
@@ -2305,6 +2368,10 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet)
     }
   }
       
+  if (fRecoParam.GetDetRecoParamArray(iDet) && !AliReconstructor::GetRecoParam(iDet)) {
+    const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet);
+    reconstructor->SetRecoParam(par);
+  }
   return reconstructor;
 }
 
@@ -2370,6 +2437,9 @@ void AliReconstruction::CleanUp(TFile* file, TFile* fileOld)
     delete fTracker[iDet];
     fTracker[iDet] = NULL;
   }
+  if (fRunInfo) delete fRunInfo;
+  fRunInfo = NULL;
+
   delete fVertexer;
   fVertexer = NULL;
 
@@ -2802,4 +2872,176 @@ Bool_t AliReconstruction::SetRunQA(TString detAndAction)
        return kTRUE; 
 } 
 
-       
+//_____________________________________________________________________________
+Bool_t AliReconstruction::InitRecoParams() 
+{
+  // The method accesses OCDB and retrieves all
+  // the available reco-param objects from there.
+
+  Bool_t isOK = kTRUE;
+
+  for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) {
+
+    if (fRecoParam.GetDetRecoParamArray(iDet)) {
+      AliInfo(Form("Using custom reconstruction parameters for detector %s",fgkDetectorName[iDet]));
+      continue;
+    }
+
+    AliDebug(1, Form("Loading RecoParam objects for detector: %s",fgkDetectorName[iDet]));
+  
+    AliCDBPath path(fgkDetectorName[iDet],"Calib","RecoParam");
+    AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath());
+    if(!entry){ 
+      AliWarning(Form("Couldn't find RecoParam entry in OCDB for detector %s",fgkDetectorName[iDet]));
+      isOK = kFALSE;
+    }
+    else {
+      TObject *recoParamObj = entry->GetObject();
+      if (dynamic_cast<TObjArray*>(recoParamObj)) {
+       // The detector has a normal TobjArray of AliDetectorRecoParam objects
+       // Registering them in AliRecoParam
+       fRecoParam.AddDetRecoParamArray(iDet,dynamic_cast<TObjArray*>(recoParamObj));
+      }
+      else if (dynamic_cast<AliDetectorRecoParam*>(recoParamObj)) {
+       // The detector has only onse set of reco parameters
+       // Registering it in AliRecoParam
+       AliInfo(Form("Single set of reco parameters found for detector %s",fgkDetectorName[iDet]));
+       dynamic_cast<AliDetectorRecoParam*>(recoParamObj)->SetAsDefault();
+       fRecoParam.AddDetRecoParam(iDet,dynamic_cast<AliDetectorRecoParam*>(recoParamObj));
+      }
+      else {
+       AliError(Form("No valid RecoParam object found in the OCDB for detector %s",fgkDetectorName[iDet]));
+       isOK = kFALSE;
+      }
+      entry->SetOwner(0);
+    }
+  }
+
+  return isOK;
+}
+
+//_____________________________________________________________________________
+Bool_t AliReconstruction::GetEventInfo() 
+{
+  // Fill the event info object
+  // ...
+  AliCodeTimerAuto("")
+
+  AliCentralTrigger *aCTP = NULL;
+  if (fRawReader) {
+    fEventInfo.SetEventType(fRawReader->GetType());
+
+    ULong64_t mask = fRawReader->GetClassMask();
+    fEventInfo.SetTriggerMask(mask);
+    UInt_t clmask = fRawReader->GetDetectorPattern()[0];
+    fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(clmask));
+
+    aCTP = new AliCentralTrigger();
+    TString configstr("");
+    if (!aCTP->LoadConfiguration(configstr)) { // Load CTP config from OCDB
+      AliError("No trigger configuration found in OCDB! The trigger configuration information will not be used!");
+      delete aCTP;
+      return kFALSE;
+    }
+    aCTP->SetClassMask(mask);
+    aCTP->SetClusterMask(clmask);
+  }
+  else {
+    fEventInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent);
+
+    if (fRunLoader && (!fRunLoader->LoadTrigger())) {
+      aCTP = fRunLoader->GetTrigger();
+      fEventInfo.SetTriggerMask(aCTP->GetClassMask());
+      fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(aCTP->GetClusterMask()));
+    }
+    else {
+      AliWarning("No trigger can be loaded! The trigger information will not be used!");
+      return kFALSE;
+    }
+  }
+
+  AliTriggerConfiguration *config = aCTP->GetConfiguration();
+  if (!config) {
+    AliError("No trigger configuration has been found! The trigger configuration information will not be used!");
+    if (fRawReader) delete aCTP;
+    return kFALSE;
+  }
+
+  TString trclasses;
+  ULong64_t trmask = fEventInfo.GetTriggerMask();
+  const TObjArray& classesArray = config->GetClasses();
+  Int_t nclasses = classesArray.GetEntriesFast();
+  for( Int_t iclass=0; iclass < nclasses; iclass++ ) {
+    AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At(iclass);
+    if (trclass) {
+      Int_t trindex = (Int_t)TMath::Log2(trclass->GetMask());
+      fesd->SetTriggerClass(trclass->GetName(),trindex);
+      if (trmask & (1 << trindex)) {
+       trclasses += " ";
+       trclasses += trclass->GetName();
+       trclasses += " ";
+      }
+    }
+  }
+  fEventInfo.SetTriggerClasses(trclasses);
+
+  if (!aCTP->CheckTriggeredDetectors()) {
+    if (fRawReader) delete aCTP;
+    return kFALSE;
+  }    
+
+  if (fRawReader) delete aCTP;
+
+  // We have to fill also the HLT decision here!!
+  // ...
+
+  return kTRUE;
+}
+
+const char *AliReconstruction::MatchDetectorList(const char *detectorList, UInt_t detectorMask)
+{
+  // Match the detector list found in the rec.C or the default 'ALL'
+  // to the list found in the GRP (stored there by the shuttle PP which
+  // gets the information from ECS)
+  static TString resultList;
+  TString detList = detectorList;
+
+  resultList = "";
+
+  for(Int_t iDet = 0; iDet < (AliDAQ::kNDetectors-1); iDet++) {
+    if ((detectorMask >> iDet) & 0x1) {
+      TString det = AliDAQ::OfflineModuleName(iDet);
+      if ((detList.CompareTo("ALL") == 0) ||
+         detList.BeginsWith("ALL ") ||
+         detList.EndsWith(" ALL") ||
+         detList.Contains(" ALL ") ||
+         (detList.CompareTo(det) == 0) ||
+         detList.BeginsWith(det) ||
+         detList.EndsWith(det) ||
+         detList.Contains( " "+det+" " )) {
+       if (!resultList.EndsWith(det + " ")) {
+         resultList += det;
+         resultList += " ";
+       }
+      }               
+    }
+  }
+
+  // HLT
+  if ((detectorMask >> AliDAQ::kHLTId) & 0x1) {
+    TString hltDet = AliDAQ::OfflineModuleName(AliDAQ::kNDetectors-1);
+    if ((detList.CompareTo("ALL") == 0) ||
+       detList.BeginsWith("ALL ") ||
+       detList.EndsWith(" ALL") ||
+       detList.Contains(" ALL ") ||
+       (detList.CompareTo(hltDet) == 0) ||
+       detList.BeginsWith(hltDet) ||
+       detList.EndsWith(hltDet) ||
+       detList.Contains( " "+hltDet+" " )) {
+      resultList += hltDet;
+    }
+  }
+
+  return resultList.Data();
+
+}
index 2fb8bb8cc73c79919b35a28c2fbd2771776e8045..90785d6043c4b410262451c580786fe701d9dcfe 100644 (file)
@@ -37,6 +37,11 @@ class TTree;
 class TList;
 class AliQADataMakerSteer; 
 class TMap;
+class AliRecoParam;
+class AliDetectorRecoParam;
+class AliRunInfo;
+#include "AliEventInfo.h"
+#include "AliRecoParam.h"
 
 class AliReconstruction: public TNamed {
 public:
@@ -54,6 +59,7 @@ public:
   void           SetNumberOfEventsPerFile(UInt_t nEvents)
     {fNumberOfEventsPerFile = nEvents;};
   void           SetOption(const char* detector, const char* option);
+  void           SetRecoParam(const char* detector, AliDetectorRecoParam *par);
 
   void           SetRunLocalReconstruction(const char* detectors) {
     fRunLocalReconstruction = detectors;};
@@ -139,6 +145,11 @@ public:
   // Plane Efficiency Evaluation
   void    SetRunPlaneEff(Bool_t flag=kFALSE)  {fRunPlaneEff = flag;}
 
+  enum {
+    fgkNDetectors = 15   // number of detectors
+  };
+  static Int_t   GetDetIndex(const char * detector);
+
 private:
   AliReconstruction(const AliReconstruction& rec);
   AliReconstruction& operator = (const AliReconstruction& rec);
@@ -173,7 +184,6 @@ private:
   void           FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd);
 
   //Quality Assurance
-  Int_t                GetDetIndex(const char * detector);
   const Int_t          GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; }
   void                 CheckQA() ;
 
@@ -184,6 +194,11 @@ private:
   Bool_t               InitAliEVE();
   void                 RunAliEVE();
 
+  Bool_t         InitRecoParams(); // init the array with the reconstruciton parameters
+  Bool_t         GetEventInfo();   // fill the event info inside the event loop
+
+  const char    *MatchDetectorList(const char *detectorList, UInt_t detectorMask);
+
   //*** Magnetic field map settings *******************
   Bool_t         fUniformField;       // uniform field tracking flag
   AliMagF       *fForcedFieldMap;     // independent, not GRP, field map
@@ -224,14 +239,16 @@ private:
   TString        fLoadAlignData;      // Load alignment data from CDB for these detectors
   TString        fESDPar;             // String where the esd.par is stored, will be attached to the tree         
   TString        fUseHLTData;        // Detectors for which the HLT data is used as input
+  AliRunInfo*    fRunInfo;            // an object which contains essential global conditions information
+  AliEventInfo   fEventInfo;          // an object which contains essential event information
 
   AliRunLoader*  fRunLoader;          //! current run loader object
   AliRawReader*  fRawReader;          //! current raw data reader
   AliRawReader*  fParentRawReader;    //! parent raw data reader in case of AliRawReaderHLT
 
-  static const Int_t fgkNDetectors = 15;   //! number of detectors
   static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
   AliReconstructor*  fReconstructor[fgkNDetectors];  //! array of reconstructor objects
+  AliRecoParam   fRecoParam;                      //! container for the reco-param objects for detectors
   AliLoader*     fLoader[fgkNDetectors];   //! detector loaders
   AliVertexer*   fVertexer;                //! vertexer for ITS
   AliTracker*    fTracker[fgkNDetectors];  //! trackers
@@ -275,7 +292,7 @@ private:
   Bool_t               fIsNewRunLoader; // galice.root created from scratch (real raw data case)
   Bool_t               fRunAliEVE;  // Run AliEVE or not
 
-  ClassDef(AliReconstruction, 24)      // class for running the reconstruction
+  ClassDef(AliReconstruction, 25)      // class for running the reconstruction
 };
 
 #endif
index a003f2ea0440e664dee12b44cc7e87423b122dd8..677cc3b369c10fd29c2218aea4aead58bc694812 100644 (file)
 
 #include "AliLog.h"
 #include "AliReconstructor.h"
+#include <TClass.h>
 #include <TString.h>
 
 
 ClassImp(AliReconstructor)
 
+const AliDetectorRecoParam* AliReconstructor::fgRecoParam[AliReconstruction::fgkNDetectors] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
 
 //_____________________________________________________________________________
 void AliReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, 
@@ -100,3 +102,34 @@ const char* AliReconstructor::GetDetectorName() const
   detName.Remove(detName.Index("Reconstructor"));
   return detName.Data();
 }
+
+//_____________________________________________________________________________
+void AliReconstructor::SetRecoParam(const AliDetectorRecoParam *par)
+{
+  // To be implemented by the detectors.
+  // As soon as we manage to remove the static members
+  // and method in the detector reconstructors, we will
+  // implemented this method in the base class and remove
+  // the detectors implementations.
+  Int_t iDet = AliReconstruction::GetDetIndex(GetDetectorName());
+
+  if (iDet >= 0)
+    fgRecoParam[iDet] = par;
+  else
+    AliError(Form("Invalid detector index for (%s)",GetDetectorName()));
+
+  return;
+}
+
+//_____________________________________________________________________________
+const AliDetectorRecoParam* AliReconstructor::GetRecoParam(Int_t iDet)
+{
+  // Get the current reconstruciton parameters
+  // for a given detector 
+  if (iDet >= 0 && iDet < AliReconstruction::fgkNDetectors)
+    return fgRecoParam[iDet];
+  else {
+    AliErrorClass(Form("Invalid detector index (%d)",iDet));
+    return NULL;
+  }
+}
index 518f805150611cfa7494e51a2471b2e1d646d8d1..51cf40aa1d7b98499fa3911d3239f99b8bab4553 100644 (file)
@@ -19,7 +19,9 @@ class AliRawReader;
 class AliVertexer;
 class AliTracker;
 class AliESDEvent;
+class AliDetectorRecoParam;
 
+#include "AliReconstruction.h"
 
 class AliReconstructor: public TObject {
 public:
@@ -49,8 +51,12 @@ public:
   void                 SetOption(Option_t* option) {fOption = option;};
   virtual Option_t*    GetOption() const {return fOption.Data();};
 
+  void                               SetRecoParam(const AliDetectorRecoParam *par);
+  static const AliDetectorRecoParam* GetRecoParam(Int_t iDet);
+
 private:
-  TString              fOption;   //! option for reconstruction
+  TString                            fOption;                                       //! option for reconstruction
+  static const AliDetectorRecoParam* fgRecoParam[AliReconstruction::fgkNDetectors]; //! event reconstruction parameters for all detectors
 
   ClassDef(AliReconstructor, 0)   // base class for reconstruction algorithms
 };
diff --git a/STEER/AliRunInfo.cxx b/STEER/AliRunInfo.cxx
new file mode 100644 (file)
index 0000000..d7bed17
--- /dev/null
@@ -0,0 +1,91 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//////////////////////////////////////////////////////////////////////////////
+//                          Class AliRunInfo                                //
+//   Container class for all the information related to LHCstate, run type, //
+//   active detectors, beam energy etc.                                     //
+//   It is used together with the AliEventInfo in order to provide          //
+//   the AliRecoParam object with                                           //
+//   the necessary information so that it can decide which instance of      //
+//   AliDetectorRecoParam objects to use in reconstruction one particular   //
+//   event.                                                                 //
+//                                                                          //
+//   cvetan.cheshkov@cern.ch 12/06/2008                                     //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliRunInfo.h"
+
+ClassImp(AliRunInfo)
+
+//______________________________________________________________________________
+AliRunInfo::AliRunInfo():
+  TObject(),
+  fLHCState("UNKNOWN"),
+  fBeamType("UNKNOWN"),
+  fBeamEnergy(0),
+  fRunType("UNKNOWN"),
+  fActiveDetectors(0)
+{
+  // default constructor
+  // ...
+}
+
+//______________________________________________________________________________
+AliRunInfo::AliRunInfo(const char *lhcState,
+                      const char *beamType,
+                      Float_t beamEnergy,
+                      const char *runType,
+                      UInt_t activeDetectors):
+  TObject(),
+  fLHCState(lhcState),
+  fBeamType(beamType),
+  fBeamEnergy(beamEnergy),
+  fRunType(runType),
+  fActiveDetectors(activeDetectors)
+{
+  // constructor
+  // ...
+}
+
+//______________________________________________________________________________
+AliRunInfo::AliRunInfo(const AliRunInfo &evInfo):
+  TObject(evInfo),
+  fLHCState(evInfo.fLHCState),
+  fBeamType(evInfo.fBeamType),
+  fBeamEnergy(evInfo.fBeamEnergy),
+  fRunType(evInfo.fRunType),
+  fActiveDetectors(evInfo.fActiveDetectors)
+{
+  // Copy constructor
+  // ...
+}
+
+//_____________________________________________________________________________
+AliRunInfo &AliRunInfo::operator =(const AliRunInfo& evInfo)
+{
+  // assignment operator
+  // ...
+  if(this==&evInfo) return *this;
+  ((TObject *)this)->operator=(evInfo);
+
+  fLHCState = evInfo.fLHCState;
+  fBeamType = evInfo.fBeamType;
+  fBeamEnergy = evInfo.fBeamEnergy;
+  fRunType = evInfo.fRunType;
+  fActiveDetectors = evInfo.fActiveDetectors;
+
+  return *this;
+}
diff --git a/STEER/AliRunInfo.h b/STEER/AliRunInfo.h
new file mode 100644 (file)
index 0000000..db7b349
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef ALIRUNINFO_H
+#define ALIRUNINFO_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//////////////////////////////////////////////////////////////////////////////
+//                          Class AliRunInfo                                //
+//   Container class for all the information related to LHCstate, run type, //
+//   active detectors, beam energy etc.                                     //
+//   It is used together with the AliEventInfo in order to provide          //
+//   the AliRecoParam object with                                           //
+//   the necessary information so that it can decide which instance of      //
+//   AliDetectorRecoParam objects to use in reconstruction one particular   //
+//   event.                                                                 //
+//                                                                          //
+//   cvetan.cheshkov@cern.ch 12/06/2008                                     //
+//////////////////////////////////////////////////////////////////////////////
+
+#include <TObject.h>
+#include <TObjString.h>
+
+#include "AliDAQ.h"
+
+class AliRunInfo : public TObject {
+
+ public:
+  AliRunInfo();
+  AliRunInfo(const char *lhcState,
+            const char *beamType,
+            Float_t beamEnergy,
+            const char *runType,
+            UInt_t activeDetectors);
+  virtual ~AliRunInfo() {}
+
+  virtual void Print(Option_t */*option=""*/) const { Dump(); }
+
+  const char *GetLHCState() const { return fLHCState.Data(); }
+  const char *GetBeamType() const { return fBeamType.Data(); }
+  const char *GetRunType() const { return fRunType.Data(); }
+  UInt_t      GetDetectorMask() const { return fActiveDetectors; }
+  const char *GetActiveDetectors() const { return AliDAQ::ListOfTriggeredDetectors(fActiveDetectors); }
+
+  AliRunInfo(const AliRunInfo &evInfo);
+  AliRunInfo& operator= (const AliRunInfo& evInfo);
+
+ private:
+
+  TString  fLHCState;       // state of the machine as provided by DCS and DAQ log-book (per run)
+  TString  fBeamType;       // beam type for Alice
+  Float_t  fBeamEnergy;     // beam energy (in GeV)
+  TString  fRunType;        // run type accoring to ECS (per run)
+  UInt_t   fActiveDetectors;// list of active detectors (per run)
+
+  ClassDef(AliRunInfo,1)     // Run info class
+};
+
+#endif
index 6ae6a146c08f73f325a69cadf5f64eac937b9e64..0887a7bb3639c8a37c5dd9f2874878460fca4678 100644 (file)
@@ -1313,7 +1313,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName,
     if (!runLoader->LoadTrigger()) {
       AliCentralTrigger *aCTP = runLoader->GetTrigger();
       if (aCTP->GetClassMask() == 0) continue;
-      detClust = aCTP->GetTriggeredDetectors();
+      detClust = AliDAQ::ListOfTriggeredDetectors(aCTP->GetClusterMask());
       AliInfo(Form("List of detectors to be read out: %s",detClust.Data()));
     }
 
index 14110c58b4132b136605b77bb4c3536748e8b931..8ce6e9fa6ee08a261691f76448200145ad83db8f 100644 (file)
@@ -69,30 +69,6 @@ const char* AliTriggerInput::fgkCTPDetectorName[AliDAQ::kNDetectors] = {
   "HLT"
 };
 
-const char* AliTriggerInput::fgkOfflineModuleName[AliDAQ::kNDetectors] = {
-  "ITS",
-  "ITS",
-  "ITS",
-  "TPC",
-  "TRD",
-  "TOF",
-  "HMPID",
-  "PHOS",
-  "CPV",
-  "PMD",
-  "MUON",
-  "MUON",
-  "FMD",
-  "T0",
-  "VZERO",
-  "ZDC",
-  "ACORDE",
-  "CTP",
-  "EMCAL",
-  "",
-  "HLT"
-};
-
 //_____________________________________________________________________________
   AliTriggerInput::AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature, Char_t number ):
     TNamed( name.Data(), det.Data() ),
@@ -153,7 +129,7 @@ TString AliTriggerInput::GetModule() const
   // Get the detector module name (in AliRoot simulation sense)
   TString name = "";
   if (fDetectorId >= 0 && fDetectorId < AliDAQ::kNDetectors)
-    name = fgkOfflineModuleName[(Int_t)fDetectorId];
+    name = AliDAQ::OfflineModuleName((Int_t)fDetectorId);
   else
     AliError(Form("Invalid detector Id (%d)",(Int_t)fDetectorId));
 
index 6d83a243c74d55da4e65d844737611cf235f252d..7bb4508a8e6f8b2303ccef6a8cf0af709e272bb6 100644 (file)
@@ -76,7 +76,6 @@ public:
 
           static Bool_t  fgkIsTriggerDetector[AliDAQ::kNDetectors]; // List of trigger detectors
    static  const char*    fgkCTPDetectorName[AliDAQ::kNDetectors];
-   static  const char*    fgkOfflineModuleName[AliDAQ::kNDetectors];
 protected:
              ULong64_t    fMask;                //  Trigger ID mask (1 bit)
              ULong64_t    fValue;               //  Trigger Signal (0 = false, > 1 = true = fMask )
@@ -86,7 +85,7 @@ protected:
                Bool_t    fIsActive;            //  Is trigger input active (during simulation)
 //                  void    fDectParameterTable;  //-> link to detector parameter table????
 
-   ClassDef( AliTriggerInput, 3 )  // Define a Trigger Input
+   ClassDef( AliTriggerInput, 4 )  // Define a Trigger Input
 };
 
 
index eb2949aeeab15450f5a748e8573eb975bd2b1498..5cc83ca9746628b766d47c781bd042629b71257f 100644 (file)
 #pragma link C++ class AliTriggerRunScalers+;
 #pragma link C++ class AliGRPPreprocessor+;
 
+#pragma link C++ class AliRunInfo+;
 #pragma link C++ class AliEventInfo+;
 
 #pragma link C++ class AliRelAlignerKalman+;
index 3aaf3193b90413a0646a4ed8e1ce1c1f55d2dbde..8a646c711350c2a5294e0f4c4598bcf34cc70521 100644 (file)
@@ -62,7 +62,7 @@ AliRecoParam.cxx \
 AliDetectorRecoParam.cxx \
 AliPlaneEff.cxx \
 AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \
-AliEventInfo.cxx \
+AliRunInfo.cxx AliEventInfo.cxx \
 AliRelAlignerKalman.cxx
 
 
index 3f2b51e3719da6d11334d7f5b220978c6e86134b..737fa82539f3df2a96af4dbeed280888649d4cad 100644 (file)
@@ -36,7 +36,6 @@
 ClassImp(AliTPCReconstructor)
 
 
-AliTPCRecoParam *    AliTPCReconstructor::fgkRecoParam =0;  // reconstruction parameters
 Int_t    AliTPCReconstructor::fgStreamLevel     = 0;        // stream (debug) level
 
 
@@ -61,7 +60,6 @@ fClusterer(NULL)
 //_____________________________________________________________________________
 AliTPCReconstructor::~AliTPCReconstructor()
 {
-  if (fgkRecoParam) delete fgkRecoParam;
   if (fClusterer)   delete fClusterer;
 }
 
@@ -118,29 +116,3 @@ AliTPCParam* AliTPCReconstructor::GetTPCParam() const
 
   return param;
 }
-
-
-
-
-const AliTPCRecoParam* AliTPCReconstructor::GetRecoParam(){ 
-  //
-  // Get reconstruction parameters
-  //
-  
-   if (!fgkRecoParam) {
-    //
-    // 1. try to get reco parameters from OCDB 
-    //
-    fgkRecoParam = AliTPCcalibDB::Instance()->GetRecoParam(0);
-    //Info("","Reconstruction parameters from OCDB used");
-    //
-    // 2. If not initialized take default
-    //
-    if (!fgkRecoParam){
-      fgkRecoParam = AliTPCRecoParam::GetHighFluxParam();
-      //Error("","Default reconstruction parameters  used");
-    }
-  }
-
-  return fgkRecoParam;
-}
index c1b25d58adc41d126703a5f06fb8fc0feebbb21e..56870f04deb1cbada18c777f9c3e82d2773d2132 100644 (file)
@@ -27,19 +27,17 @@ public:
                               AliESDEvent* esd) const
   {FillESD((TTree*)NULL,(TTree*)NULL,esd);}
 
-  static void SetRecoParam(AliTPCRecoParam * param) { fgkRecoParam = param;}
-  static const AliTPCRecoParam* GetRecoParam();
+  static const AliTPCRecoParam* GetRecoParam() { return dynamic_cast<const AliTPCRecoParam*>(AliReconstructor::GetRecoParam(1)); }
   //
-  static Double_t GetCtgRange()     { return fgkRecoParam->GetCtgRange();}
-  static Double_t GetMaxSnpTracker(){ return fgkRecoParam->GetMaxSnpTracker();}
-  static Double_t GetMaxSnpTrack()  { return fgkRecoParam->GetMaxSnpTrack();}
+  static Double_t GetCtgRange()     { return GetRecoParam()->GetCtgRange();}
+  static Double_t GetMaxSnpTracker(){ return GetRecoParam()->GetMaxSnpTracker();}
+  static Double_t GetMaxSnpTrack()  { return GetRecoParam()->GetMaxSnpTrack();}
 
   static Int_t StreamLevel()               { return fgStreamLevel;}
   static void  SetStreamLevel(Int_t level) { fgStreamLevel = level;}
 
 private:
   AliTPCParam*         GetTPCParam() const;
-  static AliTPCRecoParam *   fgkRecoParam; // reconstruction parameters
   static Int_t               fgStreamLevel; // flag for streaming      - for TPC reconstruction
   AliTPCclustererMI*         fClusterer;   // TPC clusterer
 
index 79685edf222e254399b6230759de74e490375ce2..02898d2ee50016d3ac31b2e1934ef5b369abd5e6 100644 (file)
@@ -165,7 +165,6 @@ AliTPCcalibDB::AliTPCcalibDB():
   fPedestals(0),
   fTemperature(0),
   fMapping(0),
-  fRecoParamArray(0),
   fParam(0),
   fClusterParam(0)
 {
@@ -187,7 +186,6 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ):
   fPedestals(0),
   fTemperature(0),
   fMapping(0),
-  fRecoParamArray(0),
   fParam(0),
   fClusterParam(0)
 
@@ -300,14 +298,6 @@ void AliTPCcalibDB::Update(){
     fTemperature = (AliTPCSensorTempArray*)entry->GetObject();
   }
 
-
-  entry          = GetCDBEntry("TPC/Calib/RecoParam");
-  if (entry){
-    entry->SetOwner(kTRUE);
-    fRecoParamArray = (TObjArray*)(entry->GetObject());
-  }
-
-
   entry          = GetCDBEntry("TPC/Calib/Parameters");
   if (entry){
     //if (fPadNoise) delete fPadNoise;
@@ -655,17 +645,3 @@ void AliTPCcalibDB::MakeTree(const char * fileName, TObjArray * array, const cha
       delete[] mapNames;
    }
 }
-
-
-AliTPCRecoParam *  AliTPCcalibDB::GetRecoParam(Int_t */*eventtype*/){
-  //
-  // 
-  //
-  if (!fRecoParamArray){
-    return 0;  // back compatible sollution
-  };
-  
-  AliTPCRecoParam * param = (AliTPCRecoParam*)fRecoParamArray->At(0);
-  return param;
-
-}
index 1592fbc748978a2c8c1db172c829d2038047674e..590bc9f4796379f666d99031fa3f18c9e6100f07 100644 (file)
@@ -20,7 +20,6 @@ class AliCDBEntry;
 class AliTPCParam;
 class AliTPCAltroMapping;
 class AliTPCClusterParam;
-class AliTPCRecoParam;
 //class AliCDBStorage;
 
 class AliTPCcalibDB : public TObject
@@ -42,7 +41,6 @@ class AliTPCcalibDB : public TObject
   AliTPCParam*  GetParameters(){return fParam;}
   AliTPCAltroMapping ** GetMapping(){ return fMapping;}
   AliTPCClusterParam *GetClusterParam(){ return fClusterParam;}
-  AliTPCRecoParam *   GetRecoParam(Int_t *eventtype);
   //
   static void     CreateObjectList(const Char_t *filename, TObjArray *calibObjects);
   static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9);
@@ -64,7 +62,6 @@ protected:
   AliTPCCalPad* fPedestals;       // Pedestal calibration entry
   AliTPCSensorTempArray* fTemperature; // Temperature calibration entry
   AliTPCAltroMapping **fMapping;   // Altro mapping   
-  TObjArray * fRecoParamArray;     // reconstruction parameters
   //
   //
   AliTPCParam * fParam;           // TPC parameters
index fb506015059e20ac5b397203e0976cffc4697982..d08cd08fd6e643b672f6139399d2f129266aa4c1 100644 (file)
 
 ClassImp(AliTRDReconstructor)
 
-AliTRDrecoParam* AliTRDReconstructor::fgRecoParam = 0x0; 
-
 //_____________________________________________________________________________
 AliTRDReconstructor::~AliTRDReconstructor()                  { 
-       if(fgRecoParam) delete fgRecoParam;
 }
 
 
index b887ecf4e9d6346ca5c3208ebd18cd21b8ffe627..62219be3e1ca456c69f3687ddbb4359a6d92bafb 100644 (file)
 #include "AliReconstructor.h"
 
 class AliRawReader;
-class AliTRDrecoParam;
+
+#include "AliDetectorRecoParam.h"
+#include "AliTRDrecoParam.h"
+
 class AliTRDReconstructor: public AliReconstructor 
 {
 
@@ -31,7 +34,6 @@ class AliTRDReconstructor: public AliReconstructor
 
   virtual void             Reconstruct(AliRawReader *rawReader, TTree *clusterTree) const;
   virtual void             Reconstruct(TTree *digitsTree, TTree *clusterTree) const;
-  static  AliTRDrecoParam *RecoParam()                           { return fgRecoParam;      }
   virtual AliTracker      *CreateTracker() const;
 
   virtual void             FillESD(AliRawReader */*rawReader*/, TTree *clusterTree, AliESDEvent *esd) const
@@ -40,12 +42,7 @@ class AliTRDReconstructor: public AliReconstructor
                                                                  , esd);                    }
   virtual void             FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const;
 
-  static  void             SetRecoParam(AliTRDrecoParam *reco)   { fgRecoParam   = reco;    }
-
-
- private:
-
-  static  AliTRDrecoParam *fgRecoParam;   //  Reconstruction parameters
+  static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast<const AliTRDrecoParam*>(AliReconstructor::GetRecoParam(2)); }
 
   ClassDef(AliTRDReconstructor,0)         //  Class for the TRD reconstruction
 
index 2a02ae4ba79b1958319e6977fd5649a2ee0f4c4a..506d3948f919d7796a3218b4ad2db489d401837e 100644 (file)
@@ -337,7 +337,7 @@ void AliTRDchamberTimeBin::BuildIndices(Int_t iter)
                fX += cl->GetX(); \r
                \r
                // Debug Streaming\r
-               if(AliTRDtrackerV1::DebugStreamer() && AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 3){\r
+               if(AliTRDtrackerV1::DebugStreamer() && AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 3){\r
                        TTreeSRedirector &cstream = *AliTRDtrackerV1::DebugStreamer();\r
                        cstream << "BuildIndices"\r
                        << "Plane="    << fPlane\r
@@ -556,7 +556,7 @@ void AliTRDchamberTimeBin::BuildCond(AliTRDcluster *cl, Double_t *cond, UChar_t
 //End_Html\r
 //\r
 \r
-       if(!AliTRDReconstructor::RecoParam()){\r
+       if(!AliTRDReconstructor::GetRecoParam()){\r
                AliError("Reconstruction parameters not initialized.");\r
                return;\r
        }\r
@@ -564,13 +564,13 @@ void AliTRDchamberTimeBin::BuildCond(AliTRDcluster *cl, Double_t *cond, UChar_t
        if(Layer == 0){\r
                cond[0] = cl->GetY();                   // center: y-Direction\r
                cond[1] = cl->GetZ();                   // center: z-Direction\r
-               cond[2] = AliTRDReconstructor::RecoParam()->GetMaxPhi()   * (cl->GetX() - GetX()) + 1.0;                        // deviation: y-Direction\r
-               cond[3] = AliTRDReconstructor::RecoParam()->GetMaxTheta() * (cl->GetX() - GetX()) + 1.0;                        // deviation: z-Direction\r
+               cond[2] = AliTRDReconstructor::GetRecoParam()->GetMaxPhi()   * (cl->GetX() - GetX()) + 1.0;                     // deviation: y-Direction\r
+               cond[3] = AliTRDReconstructor::GetRecoParam()->GetMaxTheta() * (cl->GetX() - GetX()) + 1.0;                     // deviation: z-Direction\r
        } else {\r
                cond[0] = cl->GetY() + phi   * (GetX() - cl->GetX()); \r
                cond[1] = cl->GetZ() + theta * (GetX() - cl->GetX());\r
-               cond[2] = AliTRDReconstructor::RecoParam()->GetRoad0y() + phi;\r
-               cond[3] = AliTRDReconstructor::RecoParam()->GetRoad0z();\r
+               cond[2] = AliTRDReconstructor::GetRecoParam()->GetRoad0y() + phi;\r
+               cond[3] = AliTRDReconstructor::GetRecoParam()->GetRoad0z();\r
        }\r
 }\r
 \r
@@ -647,8 +647,8 @@ AliTRDcluster *AliTRDchamberTimeBin::GetNearestCluster(Double_t *cond)
 // successfull) by the help of the method FindNearestCluster\r
        \r
        \r
-       Double_t maxroad  = AliTRDReconstructor::RecoParam()->GetRoad2y();\r
-       Double_t maxroadz = AliTRDReconstructor::RecoParam()->GetRoad2z();\r
+       Double_t maxroad  = AliTRDReconstructor::GetRecoParam()->GetRoad2y();\r
+       Double_t maxroadz = AliTRDReconstructor::GetRecoParam()->GetRoad2z();\r
        \r
        Int_t index = SearchNearestCluster(cond[0],cond[1],maxroad,maxroadz);\r
        AliTRDcluster *returnCluster = 0x0;\r
index 908ea2410649d903c669056d8b9e98d6b9e7169b..ee30446036ce2236ffb57d552f48c57ffe9b85b5 100644 (file)
@@ -85,15 +85,6 @@ AliTRDclusterizer::AliTRDclusterizer()
 
   fRawVersion = AliTRDfeeParam::Instance()->GetRAWversion();
 
-  // retrive reco params
-  AliTRDrecoParam *rec = 0x0;
-  if (!(rec = AliTRDReconstructor::RecoParam())){
-    if(!(rec = trd->GetRecoParam(0))){
-      AliInfo("Using default RecoParams =  LowFluxParam.");
-      rec = AliTRDrecoParam::GetLowFluxParam();    
-    }
-    AliTRDReconstructor::SetRecoParam(rec);
-  }
 
 }
 
@@ -123,16 +114,6 @@ AliTRDclusterizer::AliTRDclusterizer(const Text_t *name, const Text_t *title)
     AliFatal("Could not get calibration object");
   }
 
-  // retrive reco params
-  AliTRDrecoParam *rec = 0x0;
-  if (!(rec = AliTRDReconstructor::RecoParam())){
-    if(!(rec = trd->GetRecoParam(0))){
-      AliInfo("Using default RecoParams =  LowFluxParam.");
-      rec = AliTRDrecoParam::GetLowFluxParam();    
-    }
-    AliTRDReconstructor::SetRecoParam(rec);
-  }
-
   fDigitsManager->CreateArrays();
 
   fRawVersion = AliTRDfeeParam::Instance()->GetRAWversion();
@@ -314,7 +295,7 @@ Bool_t AliTRDclusterizer::OpenOutput(TTree *clusterTree)
 
 
   // tracklet writing
-  if (AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()){
+  if (AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()){
     TString evfoldname = AliConfig::GetDefaultEventFolderName();
     fRunLoader         = AliRunLoader::GetRunLoader(evfoldname);
 
@@ -666,7 +647,7 @@ Bool_t AliTRDclusterizer::Raw2ClustersChamber(AliRawReader *rawReader)
   fDigitsManager->SetUseDictionaries(fAddLabels);
 
   // tracklet container for raw tracklet writing
-  if (!fTrackletContainer && AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()) 
+  if (!fTrackletContainer && AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()) 
     {
      fTrackletContainer = new UInt_t *[2];
      for (Int_t i=0; i<2 ;i++){
@@ -696,11 +677,11 @@ Bool_t AliTRDclusterizer::Raw2ClustersChamber(AliRawReader *rawReader)
       fDigitsManager->RemoveDictionaries(det);
       fDigitsManager->ClearIndexes(det);
      
-      if (!AliTRDReconstructor::RecoParam()->   IsTrackletWriteEnabled()) continue;
+      if (!AliTRDReconstructor::GetRecoParam()->   IsTrackletWriteEnabled()) continue;
       if (*(fTrackletContainer[0]) > 0 || *(fTrackletContainer[1]) > 0) WriteTracklets(det); // if there is tracklet words in this det
     }
   
-  if (AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()){
+  if (AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()){
     delete [] fTrackletContainer;
     fTrackletContainer = NULL;
   }
@@ -771,21 +752,21 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det)
   // There is no ADC threshold anymore, and simParam should not be used in clusterizer. KO
   Float_t adcThreshold   = 0; 
 
-  if (!AliTRDReconstructor::RecoParam())
+  if (!AliTRDReconstructor::GetRecoParam())
     {
       AliError("RecoParam does not exist\n");
       return kFALSE;
     }
 
   // Threshold value for the maximum
-  Float_t maxThresh      = AliTRDReconstructor::RecoParam()->GetClusMaxThresh();
+  Float_t maxThresh      = AliTRDReconstructor::GetRecoParam()->GetClusMaxThresh();
   // Threshold value for the digit signal
-  Float_t sigThresh      = AliTRDReconstructor::RecoParam()->GetClusSigThresh();
+  Float_t sigThresh      = AliTRDReconstructor::GetRecoParam()->GetClusSigThresh();
 
   // Threshold value for the maximum ( cut noise)
-  Float_t minMaxCutSigma = AliTRDReconstructor::RecoParam()->GetMinMaxCutSigma();
+  Float_t minMaxCutSigma = AliTRDReconstructor::GetRecoParam()->GetMinMaxCutSigma();
   // Threshold value for the sum pad ( cut noise)
-  Float_t minLeftRightCutSigma = AliTRDReconstructor::RecoParam()->GetMinLeftRightCutSigma();
+  Float_t minLeftRightCutSigma = AliTRDReconstructor::GetRecoParam()->GetMinLeftRightCutSigma();
 
   // Iteration limit for unfolding procedure
   const Float_t kEpsilon = 0.01;             
@@ -1001,7 +982,7 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det)
 
         // The position of the cluster in COL direction relative to the center pad (pad units)
         Double_t clusterPosCol = 0.0;
-        if (AliTRDReconstructor::RecoParam()->IsLUT()) {
+        if (AliTRDReconstructor::GetRecoParam()->IsLUT()) {
           // Calculate the position of the cluster by using the
           // lookup table method
           clusterPosCol = LUTposition(ilayer,clusterSignal[2]
@@ -1318,9 +1299,9 @@ void AliTRDclusterizer::TailCancelation(AliTRDdataArrayDigits *digitsIn
        {
          // Apply the tail cancelation via the digital filter
          // (only for non-coorupted pads)
-         if (AliTRDReconstructor::RecoParam()->IsTailCancelation()) 
+         if (AliTRDReconstructor::GetRecoParam()->IsTailCancelation()) 
            {
-             DeConvExp(inADC,outADC,nTimeTotal,AliTRDReconstructor::RecoParam()->GetTCnexp());
+             DeConvExp(inADC,outADC,nTimeTotal,AliTRDReconstructor::GetRecoParam()->GetTCnexp());
            }
        }
 
index e607b1066887f5bbd311cff7055f64f71b478a6d..1268d120fc33680bfe6fa5d91621de2905bbda52 100644 (file)
@@ -134,7 +134,7 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event)
                return -1;
        }
        
-  AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam();
+  const AliTRDrecoParam *rec = AliTRDReconstructor::GetRecoParam();
   if (!rec) {
     AliErrorGeneral("AliTRDpidESD::MakePID()", "No TRD reco param.");
     return 0x0;
index 7b25ba955faccba441a7bd5dd25dfc43411d6901..c1096e1040bd0ae1ed75bc303470dd5122e81119 100644 (file)
@@ -44,7 +44,7 @@ public:
   Double_t GetRoad2z() const                { return fkRoad2z;   }
   Double_t GetTrackLikelihood() const       { return fkTrackLikelihood;       }
   Int_t    GetStreamLevel() const           { return fkStreamLevel;           }
-  inline void GetSysCovMatrix(Double_t *sys);  
+  inline void GetSysCovMatrix(Double_t *sys) const;  
   Double_t GetMinMaxCutSigma() const        { return fMinMaxCutSigma;     };
   Double_t GetMinLeftRightCutSigma() const  { return fMinLeftRightCutSigma;  };
   Double_t GetClusMaxThresh() const         { return fClusMaxThresh;   };
@@ -141,7 +141,7 @@ private:
 };
 
 //___________________________________________________
-inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys)
+inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys) const
 {
   if(!sys) return;
   memcpy(sys, fSysCovMatrix, 5*sizeof(Double_t));
index f8de9628a6a75038ba8307ec82eed8f4bb4fac1b..6ab0fec10d4e0298fa12be818b385fecad65f170 100644 (file)
@@ -221,7 +221,7 @@ void AliTRDseedV1::CookdEdx(Int_t nslices)
                nclusters[slice]++;
        } // End of loop over clusters
 
-       if(AliTRDReconstructor::RecoParam()->GetPIDMethod() == AliTRDrecoParam::kLQPID){
+       if(AliTRDReconstructor::GetRecoParam()->GetPIDMethod() == AliTRDrecoParam::kLQPID){
        // calculate mean charge per slice (only LQ PID)
                for(int is=0; is<nslices; is++){ 
            if(nclusters[is]) fdEdx[is] /= nclusters[is];
@@ -256,7 +256,7 @@ Double_t* AliTRDseedV1::GetProbability()
     return 0x0;
   }
 
-  AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam();
+  const AliTRDrecoParam *rec = AliTRDReconstructor::GetRecoParam();
   if (!rec) {
     AliError("No TRD reco param.");
     return 0x0;
@@ -268,7 +268,7 @@ Double_t* AliTRDseedV1::GetProbability()
     AliError("No access to AliTRDCalPID object");
     return 0x0;
   }
-       //AliInfo(Form("Method[%d] : %s", AliTRDReconstructor::RecoParam()->GetPIDMethod(), pd->IsA()->GetName()));
+       //AliInfo(Form("Method[%d] : %s", AliTRDReconstructor::GetRecoParam()->GetPIDMethod(), pd->IsA()->GetName()));
 
        // calculate tracklet length TO DO
   Float_t length = (AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick());
@@ -355,13 +355,13 @@ Bool_t    AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
        // debug level 7
        //
        
-       if(!AliTRDReconstructor::RecoParam()){
+       if(!AliTRDReconstructor::GetRecoParam()){
                AliError("Seed can not be used without a valid RecoParam.");
                return kFALSE;
        }
 
        AliTRDchamberTimeBin *layer = 0x0;
-       if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7 && c){
+       if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7 && c){
                TClonesArray clusters("AliTRDcluster", 24);
                clusters.SetOwner(kTRUE);
                AliTRDcluster *cc = 0x0;
@@ -389,7 +389,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
        }
 
        Float_t  tquality;
-       Double_t kroady = AliTRDReconstructor::RecoParam()->GetRoad1y();
+       Double_t kroady = AliTRDReconstructor::GetRecoParam()->GetRoad1y();
        Double_t kroadz = fPadLength * .5 + 1.;
        
        // initialize configuration parameters
@@ -429,7 +429,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                        fZ[iTime]        = cl->GetZ();
                        ncl++;
                }
-       if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d ncl [%d] = %d", iter, fPlane, ncl));
+       if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d ncl [%d] = %d", iter, fPlane, ncl));
                
                if(ncl>1){      
                        // calculate length of the time bin (calibration aware)
@@ -470,7 +470,7 @@ Bool_t      AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t
                        
                        AliTRDseed::Update();
                }
-       if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d nclFit [%d] = %d", iter, fPlane, fN2));
+       if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d nclFit [%d] = %d", iter, fPlane, fN2));
                
                if(IsOK()){
                        tquality = GetQuality(kZcorr);
@@ -506,7 +506,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
   // 6. fit tracklet
   //   
 
-       if(!AliTRDReconstructor::RecoParam()){
+       if(!AliTRDReconstructor::GetRecoParam()){
                AliError("Seed can not be used without a valid RecoParam.");
                return kFALSE;
        }
@@ -514,7 +514,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
        const Int_t kClusterCandidates = 2 * knTimebins;
        
        //define roads
-       Double_t kroady = AliTRDReconstructor::RecoParam()->GetRoad1y();
+       Double_t kroady = AliTRDReconstructor::GetRecoParam()->GetRoad1y();
        Double_t kroadz = fPadLength * 1.5 + 1.;
        // correction to y for the tilting angle
        Float_t zcorr = kZcorr ? fTilt * (fZProb - fZref[0]) : 0.;
@@ -606,7 +606,7 @@ Bool_t      AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber
        }
        
        // number of minimum numbers of clusters expected for the tracklet
-       Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
+       Int_t kClmin = Int_t(AliTRDReconstructor::GetRecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins());
   if (fN2 < kClmin){
                AliWarning(Form("Not enough clusters to fit the tracklet %d [%d].", fN2, kClmin));
     fN2 = 0;
index 6eba051aa3ef254f1d28089e37450d0339646089..124b67a1cdfe9c1b3642ad4bd6ef4882eba8dd99 100644 (file)
@@ -605,7 +605,7 @@ Bool_t  AliTRDtrackV1::Update(AliTRDseedV1 *trklt, Double_t chisq)
   
   // insert systematic uncertainties calibration and misalignment
   Double_t sys[15];
-  AliTRDReconstructor::RecoParam()->GetSysCovMatrix(sys);
+  AliTRDReconstructor::GetRecoParam()->GetSysCovMatrix(sys);
   cov[0] += (sys[0]*sys[0]);
   cov[2] += (sys[1]*sys[1]);
 
index 3d9461f23068098a7ec8de20cbfb0899f1076883..e0d644c42b4cd7213b21a33e40d874df15e0d221 100644 (file)
@@ -418,7 +418,7 @@ Int_t AliTRDtracker::PropagateBack(AliESDEvent *event)
        Int_t    nSeed   = event->GetNumberOfTracks();
        if(!nSeed){
                // run stand alone tracking
-               if (AliTRDReconstructor::RecoParam()->IsSeeding()) Clusters2Tracks(event);
+               if (AliTRDReconstructor::GetRecoParam()->IsSeeding()) Clusters2Tracks(event);
                return 0;
        }
        
@@ -526,7 +526,7 @@ Int_t AliTRDtracker::PropagateBack(AliESDEvent *event)
                // Debug part of tracking
                TTreeSRedirector &cstream = *fDebugStreamer;
                Int_t eventNrInFile = event->GetEventNumberInFile(); // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number.
-               if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+               if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
                        if (track->GetBackupTrack()) {
                                cstream << "Tracks"
                                << "EventNrInFile="  << eventNrInFile
@@ -774,7 +774,7 @@ Int_t AliTRDtracker::RefitInward(AliESDEvent *event)
 
       // Add TRD track to ESDfriendTrack - maybe this tracks are
       // not useful for post-processing - TODO make decision
-      if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0)  {
+      if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0)  {
         seed->AddCalibObject(new AliTRDtrack(*pt2/*, kTRUE*/));
       }
       delete pt2;
@@ -782,7 +782,7 @@ Int_t AliTRDtracker::RefitInward(AliESDEvent *event)
     }
 
     // Add TRD track to ESDfriendTrack
-    if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0)  {
+    if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0)  {
       seed->AddCalibObject(new AliTRDtrack(*pt/*, kTRUE*/));
     }
     delete pt;
@@ -1560,7 +1560,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd)
               isFake = kTRUE;
            }
 
-           if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+           if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
              if ((!isFake) || ((icl3%10) == 0)) {  // Debugging print
                TTreeSRedirector &cstream = *fDebugStreamer;
                cstream << "Seeds0"
@@ -2198,7 +2198,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd)
            if (1 || (!isFake)) {
              Float_t zvertex = GetZ();
              TTreeSRedirector &cstream = *fDebugStreamer;
-             if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+             if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
                cstream << "Seeds1"
                        << "isFake="     << isFake
                        << "Vertex="     << zvertex
@@ -2419,7 +2419,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd)
          esdtrack.UpdateTrackParams(track,AliESDtrack::kTRDout);
          esdtrack.SetLabel(label);
          esd->AddTrack(&esdtrack);     
-         if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+         if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
            cstream << "Tracks"
                    << "EventNrInFile="  << eventNrInFile
                    << "ESD.="     << &esdtrack
@@ -2429,7 +2429,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd)
          }
        }
 
-       if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+       if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
          cstream << "Seeds2"
                  << "Iter="      << jter
                  << "Track.="    << track
@@ -3662,7 +3662,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1
   TGraph graphy(t1-t0,x,yt);
   TGraph graphz(t1-t0,x,zt);
 
-  if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) {
+  if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) {
     cstream << "tracklet"
            << "track.="      << track              // Track parameters
            << "tany="        << tany               // Tangent of the local track angle 
index 53e3188d005058b795d15832c76650f6f2bebc32..019c00c4798282c3aafa064c64036c32b4813bd4 100644 (file)
@@ -100,23 +100,11 @@ AliTRDtrackerV1::AliTRDtrackerV1()
 
   for (Int_t isector = 0; isector < AliTRDgeometry::kNsector; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector);
 
-  // retrive reco params
-  AliTRDrecoParam *rec = 0x0;
-  if (!(rec = AliTRDReconstructor::RecoParam())){
-    if(!(rec = trd->GetRecoParam(0))){
-      AliInfo("Using default RecoParams =  LowFluxParam.");
-      rec = AliTRDrecoParam::GetLowFluxParam();    
-    }
-    AliTRDReconstructor::SetRecoParam(rec);
-  }
-  
   for(Int_t isl =0; isl<kNSeedPlanes; isl++) fSeedTB[isl] = 0x0;
 
-  if(rec->GetStreamLevel() > 1){
-    TDirectory *savedir = gDirectory; 
-    fgDebugStreamer    = new TTreeSRedirector("TRD.TrackerDebug.root");
-    savedir->cd();
-  }
+  TDirectory *savedir = gDirectory; 
+  fgDebugStreamer    = new TTreeSRedirector("TRD.TrackerDebug.root");
+  savedir->cd();
 }
 
 //____________________________________________________________________
@@ -155,8 +143,8 @@ Int_t AliTRDtrackerV1::Clusters2Tracks(AliESDEvent *esd)
   //    See AliTRDtrackerV1::Clusters2TracksSM() for details.
   //
 
-  if(!AliTRDReconstructor::RecoParam()){
-    AliError("Reconstruction configuration not initialized. Call first AliTRDReconstructor::SetRecoParam().");
+  if(!AliTRDReconstructor::GetRecoParam()){
+    AliError("Reconstruction configuration not initialized.");
     return 0;
   }
   
@@ -316,7 +304,7 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event)
         track.UpdateESDtrack(seed);
         
         // Add TRD track to ESDfriendTrack
-        if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0 /*&& quality TODO*/){ 
+        if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0 /*&& quality TODO*/){ 
           AliTRDtrackV1 *calibTrack = new AliTRDtrackV1(track);
           calibTrack->SetOwner();
           seed->AddCalibObject(calibTrack);
@@ -423,7 +411,7 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event)
   AliInfo(Form("Number of back propagated TRD tracks: %d", found));
       
   // run stand alone tracking
-  if (AliTRDReconstructor::RecoParam()->IsSeeding()) Clusters2Tracks(event);
+  if (AliTRDReconstructor::GetRecoParam()->IsSeeding()) Clusters2Tracks(event);
   
   return 0;
 }
@@ -559,7 +547,7 @@ Int_t AliTRDtrackerV1::FollowProlongation(AliTRDtrackV1 &t)
     }
   }
 
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){
     Int_t index;
     for(int iplane=0; iplane<6; iplane++){
       AliTRDseedV1 *tracklet = GetTracklet(&t, iplane, index);
@@ -637,7 +625,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
       
         if(!(chamber = fTrSec[sector].GetChamber(stack, ilayer))) continue;
       
-        if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+        if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue;
       
         x = chamber->GetX();
       
@@ -653,7 +641,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
         if(!tracklet.AttachClustersIter(chamber, 1000.)) continue;
         tracklet.Init(&t);
         
-        if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+        if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue;
       
         break;
       }
@@ -729,7 +717,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t)
     
   } // end layers loop
 
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){
     TTreeSRedirector &cstreamer = *fgDebugStreamer;
     Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber();
     //AliTRDtrackV1 *debugTrack = new AliTRDtrackV1(t);
@@ -883,7 +871,7 @@ Float_t AliTRDtrackerV1::FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Doub
   for(Int_t ip = 0; ip < AliTRDtrackerV1::kNPlanes; ip++)
     tracklets[ip].SetCC(curvature);
 
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 5){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 5){
     //Linear Model on z-direction
     Double_t xref = CalculateReferenceX(tracklets);            // Relative to the middle of the stack
     Double_t slope = fitter->GetParameter(2);
@@ -1055,7 +1043,7 @@ Float_t AliTRDtrackerV1::FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigErro
     tracklets[iLayer].SetChi2(chi2track);
   }
   
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >=5){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >=5){
     TTreeSRedirector &cstreamer = *fgDebugStreamer;
     Int_t eventNumber                  = AliTRDtrackerDebug::GetEventNumber();
     Int_t candidateNumber      = AliTRDtrackerDebug::GetCandidateNumber();
@@ -1287,7 +1275,7 @@ Double_t AliTRDtrackerV1::FitRiemanTilt(AliTRDtrackV1 *track, AliTRDseedV1 *trac
     }
   }
   
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >=5){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >=5){
     TTreeSRedirector &cstreamer = *fgDebugStreamer;
     Int_t eventNumber                  = AliTRDtrackerDebug::GetEventNumber();
     Int_t candidateNumber      = AliTRDtrackerDebug::GetCandidateNumber();
@@ -1631,7 +1619,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksSM(Int_t sector, AliESDEvent *esd)
     nChambers = 0;
     for(int ilayer=0; ilayer<AliTRDgeometry::kNlayer; ilayer++){
       if(!(chamber = stack[ilayer])) continue;
-      if(chamber->GetNClusters() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue;
+      if(chamber->GetNClusters() < fgNTimeBins * AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue;
       nChambers++;
       //AliInfo(Form("sector %d stack %d layer %d clusters %d", sector, istack, ilayer, chamber->GetNClusters()));
     }
@@ -1689,7 +1677,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
   
   // Build initial seeding configurations
   Double_t quality = BuildSeedingConfigs(stack, configs);
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){
     AliInfo(Form("Plane config %d %d %d Quality %f"
     , configs[0], configs[1], configs[2], quality));
   }
@@ -1708,7 +1696,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
       ntracks = MakeSeeds(stack, &sseed[6*ntracks], pars);
       if(ntracks == kMaxTracksStack) break;
     }
-    if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1) AliInfo(Form("Candidate TRD tracks %d in iteration %d.", ntracks, fSieveSeeding));
+    if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1) AliInfo(Form("Candidate TRD tracks %d in iteration %d.", ntracks, fSieveSeeding));
     
     if(!ntracks) break;
     
@@ -1872,7 +1860,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
   Int_t ich = 0; while(!(chamber = stack[ich])) ich++;
   trackParams[6] = fGeom->GetSector(chamber->GetDetector());/* *alpha+shift;   // Supermodule*/
 
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){
     AliInfo(Form("Track %d [%d] nlayers %d trackQuality = %e nused %d, yref = %3.3f", itrack, trackIndex, nlayers, fTrackQuality[trackIndex], nused, trackParams[1]));
           
     Int_t nclusters = 0;
@@ -1931,7 +1919,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
   esdTrack.SetLabel(track->GetLabel());
   track->UpdateESDtrack(&esdTrack);
   // write ESD-friends if neccessary
-  if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0){
+  if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0){
     AliTRDtrackV1 *calibTrack = new AliTRDtrackV1(*track);
     calibTrack->SetOwner();
     esdTrack.AddCalibObject(calibTrack);
@@ -1951,14 +1939,14 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon
 
     // Rebuild plane configurations and indices taking only unused clusters into account
     quality = BuildSeedingConfigs(stack, configs);
-    if(quality < 1.E-7) break; //AliTRDReconstructor::RecoParam()->GetPlaneQualityThreshold()) break;
+    if(quality < 1.E-7) break; //AliTRDReconstructor::GetRecoParam()->GetPlaneQualityThreshold()) break;
     
     for(Int_t ip = 0; ip < kNPlanes; ip++){ 
       if(!(chamber = stack[ip])) continue;
       chamber->Build(fGeom);//Indices(fSieveSeeding);
     }
 
-    if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ 
+    if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ 
       AliInfo(Form("Sieve level %d Plane config %d %d %d Quality %f", fSieveSeeding, configs[0], configs[1], configs[2], quality));
     }
   } while(fSieveSeeding<10); // end stack clusters sieve
@@ -2103,7 +2091,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
     padlength[iplane] = pp->GetLengthIPad();
   }
   
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){
     AliInfo(Form("Making seeds Stack[%d] Config[%d] Tracks[%d]...", istack, config, ntracks));
   }
 
@@ -2164,7 +2152,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
         }
       
         Bool_t isFake = kFALSE;
-        if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){
+        if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){
           if (c[0]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE;
           if (c[1]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE;
           if (c[2]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE;
@@ -2208,12 +2196,12 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
               <<"\n";
         }
       
-        if(chi2[0] > AliTRDReconstructor::RecoParam()->GetChi2Z()/*7./(3. - sLayer)*//*iter*/){
+        if(chi2[0] > AliTRDReconstructor::GetRecoParam()->GetChi2Z()/*7./(3. - sLayer)*//*iter*/){
           //AliInfo(Form("Failed chi2 filter on chi2Z [%f].", chi2[0]));
           AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1);
           continue;
         }
-        if(chi2[1] > AliTRDReconstructor::RecoParam()->GetChi2Y()/*1./(3. - sLayer)*//*iter*/){
+        if(chi2[1] > AliTRDReconstructor::GetRecoParam()->GetChi2Y()/*1./(3. - sLayer)*//*iter*/){
           //AliInfo(Form("Failed chi2 filter on chi2Y [%f].", chi2[1]));
           AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1);
           continue;
@@ -2244,7 +2232,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
         //chi2[1] = GetChi2ZTest(&cseed[0]);
         Double_t like = CookLikelihood(&cseed[0], planes, chi2); // to be checked
       
-        if (TMath::Log(1.E-9 + like) < AliTRDReconstructor::RecoParam()->GetTrackLikelihood()){
+        if (TMath::Log(1.E-9 + like) < AliTRDReconstructor::GetRecoParam()->GetTrackLikelihood()){
           //AliInfo(Form("Failed likelihood %f[%e].", TMath::Log(1.E-9 + like), like));
           AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1);
           continue;
@@ -2282,7 +2270,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
       
         // AliInfo("Extrapolation done.");
         // Debug Stream containing all the 6 tracklets
-        if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){
+        if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){
           TTreeSRedirector &cstreamer = *fgDebugStreamer;
           TLinearFitter *tiltedRieman = GetTiltedRiemanFitter();
           Int_t eventNumber            = AliTRDtrackerDebug::GetEventNumber();
@@ -2314,7 +2302,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
         // do the final track fitting (Once with vertex constraint and once without vertex constraint)
         Double_t chi2Vals[3];
         chi2Vals[0] = FitTiltedRieman(&cseed[0], kFALSE);
-        if(AliTRDReconstructor::RecoParam()->IsVertexConstrained())
+        if(AliTRDReconstructor::GetRecoParam()->IsVertexConstrained())
           chi2Vals[1] = FitTiltedRiemanConstraint(&cseed[0], GetZ()); // Do Vertex Constrained fit if desired
         else
           chi2Vals[1] = 1.;
@@ -2349,7 +2337,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss
           cseed[iLayer].SetChi2Z(chi2[1]);
         }
             
-        if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){
+        if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){
           TTreeSRedirector &cstreamer = *fgDebugStreamer;
           Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber();
           Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber();
@@ -2496,7 +2484,7 @@ Int_t AliTRDtrackerV1::ImproveSeedQuality(AliTRDtrackingChamber **stack, AliTRDs
     }
 
     chi2 = FitTiltedRieman(bseed, kTRUE);
-    if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 7){
+    if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 7){
       Int_t eventNumber                = AliTRDtrackerDebug::GetEventNumber();
       Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber();
       TLinearFitter *tiltedRieman = GetTiltedRiemanFitter();
@@ -2549,13 +2537,13 @@ Double_t AliTRDtrackerV1::CalculateTrackLikelihood(AliTRDseedV1 *tracklets, Doub
   sumdaf /= Float_t (nLayers - 2.0);
   
   Double_t likeChi2Z  = TMath::Exp(-chi2[2] * 0.14);                   // Chi2Z 
-  Double_t likeChi2TC = (AliTRDReconstructor::RecoParam()->IsVertexConstrained()) ? 
+  Double_t likeChi2TC = (AliTRDReconstructor::GetRecoParam()->IsVertexConstrained()) ? 
                                                                                        TMath::Exp(-chi2[1] * 0.677) : 1;                       // Constrained Tilted Riemann
   Double_t likeChi2TR = TMath::Exp(-chi2[0] * 0.78);                   // Non-constrained Tilted Riemann
   Double_t likeAF     = TMath::Exp(-sumdaf * 3.23);
   Double_t trackLikelihood     = likeChi2Z * likeChi2TR * likeAF;
 
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){
     Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber();
     Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber();
     TTreeSRedirector &cstreamer = *fgDebugStreamer;
@@ -2602,7 +2590,7 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]
   //
 
   // ratio of the total number of clusters/track which are expected to be found by the tracker.
-  Float_t fgFindable = AliTRDReconstructor::RecoParam()->GetFindableClusters();
+  Float_t fgFindable = AliTRDReconstructor::GetRecoParam()->GetFindableClusters();
 
   
   Int_t nclusters = 0;
@@ -2622,7 +2610,7 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]
   Double_t like      = likea * likechi2y * likechi2z * likeN;
 
   //   AliInfo(Form("sumda(%f) chi2[0](%f) chi2[1](%f) likea(%f) likechi2y(%f) likechi2z(%f) nclusters(%d) likeN(%f)", sumda, chi2[0], chi2[1], likea, likechi2y, likechi2z, nclusters, likeN));
-  if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){
+  if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){
     Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber();
     Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber();
     // The Debug Stream contains the seed 
index d06b2a7d9b481a726914529f477a3e0d231b2fed..8fbd891af17271226ed105ea4cb2e947e70abd7f 100644 (file)
@@ -166,8 +166,8 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer,
        const Int_t kMaxRows = 16;\r
        const Int_t kMaxCols = 144;\r
        const Int_t kMaxPads = 2304;\r
-       Int_t timeBinMin = AliTRDReconstructor::RecoParam()->GetNumberOfPresamples();\r
-       Int_t timeBinMax = AliTRDReconstructor::RecoParam()->GetNumberOfPostsamples();\r
+       Int_t timeBinMin = AliTRDReconstructor::GetRecoParam()->GetNumberOfPresamples();\r
+       Int_t timeBinMax = AliTRDReconstructor::GetRecoParam()->GetNumberOfPostsamples();\r
 \r
        // Get the geometrical data of the chamber\r
        Int_t layer = geo->GetLayer(fDetector);\r
@@ -243,7 +243,7 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer,
        TMath::Sort(nPads, hvals, indices);                     // bins storing a 0 should not matter\r
        // Set Threshold\r
        Int_t maximum = hvals[indices[0]];      // best\r
-       Int_t threshold = Int_t(maximum * AliTRDReconstructor::RecoParam()->GetFindableClusters());\r
+       Int_t threshold = Int_t(maximum * AliTRDReconstructor::GetRecoParam()->GetFindableClusters());\r
        Int_t col, row, lower, lower1, upper, upper1;\r
        for(Int_t ib = 0; ib < nPads; ib++){\r
                if(nCandidates >= AliTRDtrackerV1::kMaxTracksStack){\r
@@ -331,7 +331,7 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer,
        fakeLayer->BuildIndices();\r
        //fakeLayer->PrintClusters();\r
        \r
-       if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 3){\r
+       if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 3){\r
                //TMatrixD hist(nRows, nCols);\r
                //for(Int_t i = 0; i < nRows; i++)\r
                //      for(Int_t j = 0; j < nCols; j++)\r
index 8424f6045435b323167e197d25fab4755865b36b..2816f9a10e1551edb6fe26b5464d36277331a86e 100644 (file)
@@ -4,6 +4,11 @@ void rec() {
   reco.SetWriteESDfriend();
   reco.SetWriteAlignmentData();
   AliTPCReconstructor::SetStreamLevel(1);
+  //  reco.SetRecoParam("ITS",AliITSRecoParam::GetLowFluxParam());
+  reco.SetRecoParam("TPC",AliTPCRecoParam::GetLowFluxParam());
+  reco.SetRecoParam("TRD",AliTRDrecoParam::GetLowFluxParam());
+  reco.SetRecoParam("PHOS",AliPHOSRecoParam::GetDefaultParameters());
+  reco.SetRecoParam("MUON",AliMUONRecoParam::GetLowFluxParam());
   //  AliTPCReconstructor::SetRecoParam(AliTPCRecoParam::GetLowFluxParam());
   //  reco.SetInput("raw.root");
   //  reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON T0 VZERO FMD PMD ZDC");
index 82118eeb97255c82a4bbe8f824ab617ce92a1373..e18853ddb72ece16c098fee31f77b78e57a44067 100644 (file)
@@ -10,15 +10,21 @@ void rec() {
   reco.SetUniformFieldTracking(kFALSE);
   reco.SetWriteESDfriend();
   reco.SetWriteAlignmentData();
-  AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam();
-  AliTPCReconstructor::SetRecoParam(tpcRecoParam);
   //  AliTPCReconstructor::SetStreamLevel(1);
-
+  //  reco.SetRecoParam("ITS",AliITSRecoParam::GetLowFluxParam());
+  reco.SetRecoParam("TPC",AliTPCRecoParam::GetLowFluxParam());
+  reco.SetRecoParam("TRD",AliTRDrecoParam::GetLowFluxParam());
+  reco.SetRecoParam("PHOS",AliPHOSRecoParam::GetDefaultParameters());
+  reco.SetRecoParam("MUON",AliMUONRecoParam::GetLowFluxParam());
   reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON FMD PMD ZDC T0 VZERO");
   reco.SetInput("raw.root");
 
   reco.SetNumberOfEventsPerFile(-1); // all events in one single file
 
+  reco.SetRunQA(":");
+  reco.SetRunGlobalQA(kTRUE);
+
   TStopwatch timer;
   timer.Start();
   reco.Run();