Adding the missing GRP entries to the esd event tag (Panos)
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Sep 2008 20:02:09 +0000 (20:02 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Sep 2008 20:02:09 +0000 (20:02 +0000)
STEER/AliESDTagCreator.cxx

index 5a3bc76d6a80d7521e0e595379403e5a07d426cd..030655f140ac3d83b5f665d10f6ee985a7cb2034 100644 (file)
@@ -30,6 +30,7 @@
 #include <TObjString.h>
 #include <TLorentzVector.h>
 #include <TMap.h>
+#include <TTimeStamp.h>
 
 //ROOT-AliEn
 #include <TGrid.h>
@@ -1162,12 +1163,31 @@ void AliESDTagCreator::CreateTag(TFile* file, const char *filepath, Int_t Counte
 }
 
 //_____________________________________________________________________________
-void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, TMap */* grpData */) {
+void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, TMap *grpData) {
   //GRP
   Float_t lhcLuminosity = 0.0;
   TString lhcState = "test";
   UInt_t detectorMask = 0;
 
+  TObjString *s = new TObjString;
+  s = (TObjString *)grpData->GetValue("fDetectorMask");
+  detectorMask = atoi(s->GetString().Data());
+  
+  s = (TObjString *)grpData->GetValue("fAliceStartTime");
+  Float_t startTime = atof(s->GetString().Data());
+  TTimeStamp *t1 = new TTimeStamp(startTime);
+
+  s = (TObjString *)grpData->GetValue("fAliceStopTime");
+  Float_t stopTime = atof(s->GetString().Data());
+  TTimeStamp *t2 = new TTimeStamp(stopTime);
+
+  s = (TObjString *)grpData->GetValue("fAliceBeamType");
+  const char* beamtype = s->GetString().Data();
+
+  s = (TObjString *)grpData->GetValue("fAliceBeamEnergy");
+  Float_t beamenergy = atof(s->GetString().Data());
+
+
   /////////////
   //muon code//
   ////////////
@@ -1442,6 +1462,11 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, TMap *
     tag->SetDetectorTag(detectorMask);
 
     tag->SetRunId(iInitRunNumber);
+    tag->SetRunStartTime(t1->GetDate());
+    tag->SetRunStopTime(t2->GetDate());
+    tag->SetBeamEnergy(beamenergy);
+    tag->SetBeamType(beamtype);
+
     tag->AddEventTag(*evTag);
   }