Adding option to skip leading tracks in randomized events
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Aug 2010 08:12:57 +0000 (08:12 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Aug 2010 08:12:57 +0000 (08:12 +0000)
JETAN/AliAnalysisTaskJetCluster.cxx
JETAN/AliAnalysisTaskJetCluster.h
PWG4/macros/AddTaskJetCluster.C
PWG4/macros/AnalysisTrainPWG4Jets.C

index d737ca5..af7f148 100644 (file)
@@ -80,7 +80,9 @@ AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster(): AliAnalysisTaskSE(),
   fUseGlobalSelection(kFALSE),
   fFilterMask(0),
   fTrackTypeRec(kTrackUndef),
-  fTrackTypeGen(kTrackUndef),  fAvgTrials(1),
+  fTrackTypeGen(kTrackUndef),  
+  fNSkipLeadingRan(0),
+  fAvgTrials(1),
   fExternalWeight(1),    
   fRecEtaWindow(0.5),
   fTrackPtCut(0.),                                                     
@@ -156,6 +158,7 @@ AliAnalysisTaskJetCluster::AliAnalysisTaskJetCluster(const char* name):
   fFilterMask(0),
   fTrackTypeRec(kTrackUndef),
   fTrackTypeGen(kTrackUndef),
+  fNSkipLeadingRan(0),
   fAvgTrials(1),
   fExternalWeight(1),    
   fRecEtaWindow(0.5),
@@ -592,22 +595,21 @@ void AliAnalysisTaskJetCluster::UserExec(Option_t */*option*/)
     inputParticlesRec.push_back(jInp);
 
     // the randomized input changes eta and phi, but keeps the p_T
-    Double_t pT = vp->Pt();
-    Double_t eta = 1.8 * gRandom->Rndm() - 0.9;
-    Double_t phi = 2.* TMath::Pi() * gRandom->Rndm();
-
-
-    Double_t theta = 2.*TMath::ATan(TMath::Exp(-2.*eta));  
-    Double_t pZ = pT/TMath::Tan(theta);
-
-    Double_t pX = pT * TMath::Cos(phi);
-    Double_t pY = pT * TMath::Sin(phi);
-    Double_t p  = TMath::Sqrt(pT*pT+pZ*pZ); 
-
-    fastjet::PseudoJet jInpRan(pX,pY,pZ,p);
-    jInpRan.set_user_index(i);
-    inputParticlesRecRan.push_back(jInpRan);
-
+    if(i>=fNSkipLeadingRan){// eventually skip the leading particles
+      Double_t pT = vp->Pt();
+      Double_t eta = 1.8 * gRandom->Rndm() - 0.9;
+      Double_t phi = 2.* TMath::Pi() * gRandom->Rndm();
+      
+      Double_t theta = 2.*TMath::ATan(TMath::Exp(-2.*eta));  
+      Double_t pZ = pT/TMath::Tan(theta);
+
+      Double_t pX = pT * TMath::Cos(phi);
+      Double_t pY = pT * TMath::Sin(phi);
+      Double_t p  = TMath::Sqrt(pT*pT+pZ*pZ); 
+      fastjet::PseudoJet jInpRan(pX,pY,pZ,p);
+      jInpRan.set_user_index(i);
+      inputParticlesRecRan.push_back(jInpRan);
+    }
 
     // fill the tref array, only needed when we write out jets
     if(jarray){
index f3b4f71..70cb809 100644 (file)
@@ -56,6 +56,8 @@ class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
     virtual void SetTrackPtCut(Float_t x){fTrackPtCut = x;}
     virtual void SetFilterMask(UInt_t i){fFilterMask = i;}
 
+    virtual void SetNSkipLeadingRan(Int_t x){fNSkipLeadingRan = x;}
+
     virtual void SetJetOutputBranch(const char *c){fNonStdBranch = c;}
     virtual void SetJetOutputFile(const char *c){fNonStdFile = c;}
     virtual void SetJetOutputMinPt(Float_t x){fJetOutputMinPt = x;}
@@ -101,6 +103,7 @@ class AliAnalysisTaskJetCluster : public AliAnalysisTaskSE
     UInt_t        fFilterMask;            // filter bit for slecected tracks
     Int_t         fTrackTypeRec;          // type of tracks used for FF 
     Int_t         fTrackTypeGen;          // type of tracks used for FF 
+    Int_t         fNSkipLeadingRan;        // number of leading tracks to be skipped in the randomized event
     Float_t       fAvgTrials;             // Average nimber of trials
     Float_t       fExternalWeight;        // external weight
     Float_t       fRecEtaWindow;          // eta window used for corraltion plots between rec and gen 
index 6e924cc..2638bbf 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec = "AOD",char* bGen = "",UInt_t filterMask = 16, Int_t iPhysicsSelection = 1,Char_t *jf = "KT", Float_t radius = 0.4);\r
+AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec = "AOD",char* bGen = "",UInt_t filterMask = 16, Int_t iPhysicsSelection = 1,Char_t *jf = "KT", Float_t radius = 0.4,Int_t nSkip = 0);\r
 \r
 \r
 AliAnalysisTaskJetCluster *AddTaskJetClusterDelta(UInt_t filterMask = 16,Bool_t kUseAODMC = kFALSE,Int_t iPhysicsSelection = 1,Char_t *jf = "KT", UInt_t iFlag){\r
@@ -26,7 +26,7 @@ AliAnalysisTaskJetCluster *AddTaskJetClusterDelta(UInt_t filterMask = 16,Bool_t
 }\r
 \r
 \r
-AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filterMask,Int_t iPhysicsSelection,Char_t *jf,Float_t radius)\r
+AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filterMask,Int_t iPhysicsSelection,Char_t *jf,Float_t radius,Int_t nSkip)\r
 {\r
 // Creates a jet fider task, configures it and adds it to the analysis manager.\r
 \r
@@ -58,7 +58,7 @@ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filte
    if(radius>0)cRadius = Form("%02d",(int)((radius+0.01)*10.));\r
 \r
    \r
-   AliAnalysisTaskJetCluster* pwg4spec = new  AliAnalysisTaskJetCluster(Form("JetCluster_%s_%s",jf,cRadius));\r
+   AliAnalysisTaskJetCluster* pwg4spec = new  AliAnalysisTaskJetCluster(Form("JetCluster_%s_%s_skip%d",jf,cRadius,nSkip));\r
       \r
    // or a config file\r
    // pwg4spec->SetAnalysisType(AliAnalysisTaskJetCluster::kAnaMC);\r
@@ -126,14 +126,16 @@ AliAnalysisTaskJetCluster *AddTaskJetCluster(char* bRec,char* bGen ,UInt_t filte
      pwg4spec->SetJetOutputMinPt(1); // store only jets / clusters above a certain threshold\r
    }\r
 \r
+   pwg4spec->SetNSkipLeadingRan(nSkip);\r
+\r
    if(iPhysicsSelection)pwg4spec->SelectCollisionCandidates();\r
 \r
    mgr->AddTask(pwg4spec);\r
-     \r
+\r
    // Create ONLY the output containers for the data produced by the task.\r
    // Get and connect other common input/output containers via the manager as below\r
    //==============================================================================\r
-   AliAnalysisDataContainer *coutput1_Spec = mgr->CreateContainer(Form("pwg4cluster_%s_%s_%s_%s",bRec,bGen,jf,cRadius), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_cluster_%s_%s_%s_%s",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cRadius));\r
+   AliAnalysisDataContainer *coutput1_Spec = mgr->CreateContainer(Form("pwg4cluster_%s_%s_%s_%s_skip%d",bRec,bGen,jf,cRadius,nSkip), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_cluster_%s_%s_%s_%s_skip%d",AliAnalysisManager::GetCommonFileName(),bRec,bGen,jf,cRadius,nSkip));\r
 \r
    mgr->ConnectInput  (pwg4spec, 0, mgr->GetCommonInputContainer());\r
    mgr->ConnectOutput (pwg4spec, 0, mgr->GetCommonOutputContainer());\r
index 545e22e..5084d7b 100644 (file)
@@ -395,6 +395,33 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
       if (!taskjets) ::Warning("AnalysisTrainPWG4Jets", "AliAnalysisTaskJets cannot run for this train conditions - EXCLUDED");
    }
 
+   if(iPWG4Cluster){
+     gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskJetCluster.C");
+     AliAnalysisTaskJetCluster *taskCl = 0;
+     if(iPWG4Cluster&1){
+       taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelection,"KT");
+       if (!taskCl) ::Warning("AnalysisTrainPWG4Jets", "AliAnalysisTaskCluster cannot run for this train conditions - EXCLUDED");
+     }
+     if(iPWG4Cluster&2){
+       UInt_t selection = 0;
+       if(!iAODanalysis) selection = 0xffffff;
+       else selection = 1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<7|1<<8|1<<9;
+       selection&=~(1<<4); // exluded R = .04 already the dafault
+       AddTaskJetClusterDelta(kHighPtFilterMask,kUseAODMC,iPhysicsSelection,"KT",selection);
+     }
+     if(iPWG4Cluster&4){
+       UInt_t selection = 0;
+       if(!iAODanalysis){
+        selection = 0xffffff;
+        selection &= ~(1<<1)&~(1<<3)&~(1<<5)&~(1<<7)&~(1<<9);
+       }
+       else selection = 1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<7|1<<8|1<<9;
+       AddTaskJetClusterDelta(kHighPtFilterMask,kUseAODMC,iPhysicsSelection,"ANTIKT",selection);
+       AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelection,"ANTIKT",0.4,1);
+
+     }
+   }
+
    if (iDIJETAN) {
       gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskDiJets.C");
       AliAnalysisTaskDiJets *taskdijets = 0;
@@ -586,33 +613,6 @@ void AnalysisTrainPWG4Jets(const char *analysis_mode="local",
      if (!taskKMeans) ::Warning("AnalysisTrainPWG4Jets", "AliAnalysisTaskKMenans cannot run for this train conditions - EXCLUDED");
    }
 
-   if(iPWG4Cluster){
-     gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskJetCluster.C");
-     AliAnalysisTaskJetCluster *taskCl = 0;
-     if(iPWG4Cluster&1){
-       taskCl = AddTaskJetCluster("AOD","",kHighPtFilterMask,iPhysicsSelection,"KT");
-     }
-     if(iPWG4Cluster&2){
-       UInt_t selection = 0;
-       if(!iAODanalysis) selection = 0xffffff;
-       else selection = 1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<7|1<<8|1<<9;
-       selection&=~(1<<4); // exluded R = .04 already the dafault
-       AddTaskJetClusterDelta(kHighPtFilterMask,kUseAODMC,iPhysicsSelection,"KT",selection);
-     }
-     if(iPWG4Cluster&4){
-       UInt_t selection = 0;
-       if(!iAODanalysis){
-        selection = 0xffffff;
-        selection &= ~(1<<1)&~(1<<3)&~(1<<5)&~(1<<7)&~(1<<9);
-       }
-       else selection = 1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<7|1<<8|1<<9;
-       AddTaskJetClusterDelta(kHighPtFilterMask,kUseAODMC,iPhysicsSelection,"ANTIKT",selection);
-     }
-
-
-     if (!taskCl) ::Warning("AnalysisTrainPWG4Jets", "AliAnalysisTaskCluster cannot run for this train conditions - EXCLUDED");
-
-   }
    if(iPWG4PartCorr){
      gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskPartCorr.C");
      AliAnalysisTaskParticleCorrelation *taskpartcorrPHOS = AddTaskPartCorr("AOD", "PHOS",kFALSE,kIsMC);