]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODTagCreator.cxx
Updates for full map (R. Shahoyan)
[u/mrichter/AliRoot.git] / STEER / AliAODTagCreator.cxx
index 6b3dd8dbf76aa7fc4f13013cd447c5d4a4bf40de..c7f4a57aba4f1077d929c914c762159ce68dbcd3 100644 (file)
@@ -173,7 +173,7 @@ Bool_t AliAODTagCreator::ReadCAFCollection(const char *filename) {
 }
 
 //__________________________________________________________________________
-void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList *grpList) {
+void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList */*grpList*/) {
   //creates tag files for AODs
   
   Float_t fLowPtCut = 1.0;
@@ -193,11 +193,6 @@ void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList
   Int_t nMu1GeV, nMu3GeV, nMu10GeV;
   Int_t nEl1GeV, nEl3GeV, nEl10GeV;
   Float_t maxPt = .0, meanPt = .0, totalP = .0;
-
-  AliRunTag *tag = new AliRunTag();
-  TTree ttag("T","A Tree with event tags");
-  TBranch * btag = ttag.Branch("AliTAG", &tag);
-  btag->SetCompressionLevel(9);
   
   //reading the esd tag file
   TChain *oldTagTree = new TChain("T");
@@ -211,14 +206,6 @@ void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList
   }//directory loop
   AliInfo(Form("Chained tag files: %d",oldTagTree->GetEntries()));
 
-  //reading the esd tag file
-  AliRunTag *oldtag = new AliRunTag();
-  TString tagFilename;
-  oldTagTree->SetBranchAddress("AliTAG",&oldtag);
-  oldTagTree->GetEntry(0);
-  tag->CopyStandardContent(oldtag);
-  const TClonesArray *evTagList = oldtag->GetEventTags();
-
   AliInfo(Form("Creating the AOD tags......."));       
 
   TFile *file = TFile::Open("AliAOD.root");
@@ -240,12 +227,25 @@ void AliAODTagCreator::CreateAODTags(Int_t fFirstEvent, Int_t fLastEvent, TList
 
   char fileName[256];
   sprintf(fileName, "Run%d.Event%d_%d.AOD.tag.root", 
-         tag->GetRunId(),fFirstEvent,lastEvent );
+         aod->GetRunNumber(),fFirstEvent,lastEvent );
   AliInfo(Form("writing tags to file %s", fileName));
   AliDebug(1, Form("writing tags to file %s", fileName));
  
   TFile* ftag = TFile::Open(fileName, "recreate");
 
+  AliRunTag *tag = new AliRunTag();
+  TTree ttag("T","A Tree with event tags");
+  TBranch * btag = ttag.Branch("AliTAG", &tag);
+  btag->SetCompressionLevel(9);
+
+  //reading the esd tag file
+  AliRunTag *oldtag = new AliRunTag();
+  TString tagFilename;
+  oldTagTree->SetBranchAddress("AliTAG",&oldtag);
+  oldTagTree->GetEntry(0);
+  tag->CopyStandardContent(oldtag);
+  const TClonesArray *evTagList = oldtag->GetEventTags();
+
   // loop over events
   Int_t nEvents = aodTree->GetEntries();
   for (Int_t iEventNumber = 0; iEventNumber < nEvents; iEventNumber++) {