]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changing the order between the tree and file creation.
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Nov 2007 16:30:36 +0000 (16:30 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Nov 2007 16:30:36 +0000 (16:30 +0000)
STEER/AliAODTagCreator.cxx
STEER/AliESDTagCreator.cxx

index 6b3dd8dbf76aa7fc4f13013cd447c5d4a4bf40de..5c29711e099d11b9231d19eed6882c6f5e6cdef5 100644 (file)
@@ -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++) {
index e09db6d3800f21f87aec948b9840dab6798f150b..363ffca12f7b080b05e8b0532d5ddf448c01b673 100644 (file)
@@ -1194,12 +1194,6 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, TList
   Int_t fVertexflag;
   Int_t iRunNumber = 0;
   TString fVertexName("default");
-
-  AliRunTag *tag = new AliRunTag();
-  AliEventTag *evTag = new AliEventTag();
-  TTree ttag("T","A Tree with event tags");
-  TBranch * btag = ttag.Branch("AliTAG", &tag);
-  btag->SetCompressionLevel(9);
   
   AliInfo(Form("Creating the ESD tags......."));       
 
@@ -1229,6 +1223,12 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, TList
  
   TFile* ftag = TFile::Open(fileName, "recreate");
  
+  AliRunTag *tag = new AliRunTag();
+  AliEventTag *evTag = new AliEventTag();
+  TTree ttag("T","A Tree with event tags");
+  TBranch * btag = ttag.Branch("AliTAG", &tag);
+  btag->SetCompressionLevel(9);
+
   if(fLastEvent != -1) iNumberOfEvents = fLastEvent + 1;
   for (Int_t iEventNumber = fFirstEvent; iEventNumber < iNumberOfEvents; iEventNumber++) {
     ntrack = 0;