jet shapes&Jet-track correlations for jets depending on their track back-to-back...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Mar 2012 13:16:06 +0000 (13:16 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 9 Mar 2012 13:16:06 +0000 (13:16 +0000)
PWGJE/AliAnalysisTaskJetCore.cxx
PWGJE/AliAnalysisTaskJetCore.h

index 6a92c64..648c10b 100644 (file)
@@ -77,8 +77,12 @@ fNInputTracksMin(0),
 fNInputTracksMax(-1),
 fAngStructCloseTracks(0),
 fCheckMethods(0),
+fDoEventMixing(0), 
 fJetEtaMin(-.5),
 fJetEtaMax(.5),
+fNevents(0x0),
+fTindex(0x0),
+fTrigBufferIndex(0x0),
 fJetPtMin(20.),
 fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
 fJetPtFractionMin(0.5),
@@ -91,8 +95,7 @@ fOutputList(0x0),
 fbEvent(kTRUE),
 fHistEvtSelection(0x0),
 fhnDeltaR(0x0),
-fhnSumBkg(0x0),  
-fhnJetCoreMethod3(0x0),
+fhnMixedEvents(0x0),
 fh2JetCoreMethod1C10(0x0),
 fh2JetCoreMethod2C10(0x0),
 fh2JetCoreMethod1C20(0x0),
@@ -119,11 +122,24 @@ fh2AngStructpt3C60(0x0),
 fh2AngStructpt4C60(0x0),
 fh3spectriggered(0x0),
 fh3specbiased(0x0),
-fh3specleadsublead(0x0)
+fh3spectot(0x0)
+
  
 {
    // default Constructor
 
+
+ // Trigger buffer.
+   for(Int_t i=0; i<10; i++) {
+               for(Int_t j=0; j<7; j++) {
+                       fTrigBuffer[i][j]=0;
+               }                               
+       }       
+
+
+
+
+
    fJetBranchName[0] = "";
    fJetBranchName[1] = "";
 
@@ -154,8 +170,12 @@ fNInputTracksMin(0),
 fNInputTracksMax(-1),
 fAngStructCloseTracks(0),
 fCheckMethods(0),
+fDoEventMixing(0),
 fJetEtaMin(-.5),
 fJetEtaMax(.5),
+fNevents(0x0),
+fTindex(0x0),
+fTrigBufferIndex(0x0),
 fJetPtMin(20.),
 fJetTriggerExcludeMask(AliAODJet::kHighTrackPtTriggered),
 fJetPtFractionMin(0.5),
@@ -168,8 +188,7 @@ fOutputList(0x0),
 fbEvent(kTRUE),
 fHistEvtSelection(0x0),
 fhnDeltaR(0x0),
-fhnSumBkg(0x0),  
-fhnJetCoreMethod3(0x0),
+fhnMixedEvents(0x0),
 fh2JetCoreMethod1C10(0x0),
 fh2JetCoreMethod2C10(0x0),
 fh2JetCoreMethod1C20(0x0),
@@ -196,10 +215,20 @@ fh2AngStructpt3C60(0x0),
 fh2AngStructpt4C60(0x0),    
 fh3spectriggered(0x0),
 fh3specbiased(0x0),
-fh3specleadsublead(0x0)
+fh3spectot(0x0)
+
  {
    // Constructor
 
+
+    for(Int_t i=0; i<10; i++) {
+       for(Int_t j=0; j<7; j++) {
+           fTrigBuffer[i][j]=0;
+               }                               
+    }  
+
+
+
    fJetBranchName[0] = "";
    fJetBranchName[1] = "";
 
@@ -251,15 +280,17 @@ void AliAnalysisTaskJetCore::UserCreateOutputObjects()
    fHistEvtSelection->GetXaxis()->SetBinLabel(5,"centrality (rejected)");
    fHistEvtSelection->GetXaxis()->SetBinLabel(6,"multiplicity (rejected)");
 
-    UInt_t entries = 0; // bit coded, see GetDimParams() below 
-    
-     entries = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 |1<<7|1<<8; 
+     UInt_t entries = 0; // bit coded, see GetDimParams() below 
+     entries = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 |1<<7; 
      fhnDeltaR = NewTHnSparseF("fhnDeltaR", entries);
-     // fhnSumBkg = NewTHnSparseF("fhnDeltaR", entries);
+   
+    
+     UInt_t cifras = 0; // bit coded, see GetDimParams() below 
+     cifras = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 |1<<7; 
+     fhnMixedEvents = NewTHnSparseF("fhnMixedEvents", cifras);
 
     if(fCheckMethods){
-      entries = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5  ; 
-     fhnJetCoreMethod3 = NewTHnSparseF("fhnEvent", entries);
+
 
     fh2JetCoreMethod1C10 = new TH2F("JetCoreMethod1C10","",150, 0., 150.,100, 0., 1.5);
     fh2JetCoreMethod2C10 = new TH2F("JetCoreMethod2C10","",150, 0., 150.,100, 0., 1.5);
@@ -290,18 +321,18 @@ void AliAnalysisTaskJetCore::UserCreateOutputObjects()
     fh2AngStructpt4C60 = new TH2F("Ang struct pt4 C60","",15,0.,1.5,150,0.,10.); }
     fh3spectriggered = new TH3F("Triggered spectrum","",10,0,100,50,0.,200,50,0.,50.);
     fh3specbiased = new TH3F("Biased spectrum","",10,0,100,50,0.,200.,50,0.,50.);
-    fh3specleadsublead = new TH3F("Leading/subleading spectrum","",10,0,100,50,0.,200.,3,0,3);
+    fh3spectot = new TH3F("Total spectrum","",50,0.,200.,50,0.,50.,50,0.,50.);
 
    fOutputList->Add(fHistEvtSelection);
 
    fOutputList->Add(fhnDeltaR);
    
-   //fOutputList->Add(fhnSumBkg);
+   fOutputList->Add(fhnMixedEvents);
          
      
   
       if(fCheckMethods){
-      fOutputList->Add(fhnJetCoreMethod3);
+
       fOutputList->Add(fh2JetCoreMethod1C10);
       fOutputList->Add(fh2JetCoreMethod2C10);
       fOutputList->Add(fh2JetCoreMethod1C20);
@@ -334,7 +365,7 @@ void AliAnalysisTaskJetCore::UserCreateOutputObjects()
        fOutputList->Add(fh2AngStructpt4C60);}  
        fOutputList->Add(fh3spectriggered);
        fOutputList->Add(fh3specbiased);
-       fOutputList->Add(fh3specleadsublead);
+       fOutputList->Add(fh3spectot);
 
    // =========== Switch on Sumw2 for all histos ===========
    for (Int_t i=0; i<fOutputList->GetEntries(); ++i) {
@@ -397,11 +428,6 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
    }
 
    // vertex selection
-   if(!fAOD){
-     PostData(1, fOutputList);
-     if(fDebug) Printf(" No AOD found ... ");
-     return;
-   }
    AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
    Int_t nTracksPrim = primVtx->GetNContributors();
    if ((nTracksPrim < fMinContribVtx) ||
@@ -461,30 +487,30 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
    aodJets[0] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[0].Data())); 
    aodJets[1] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[1].Data()));  }
    if(fAODExtension && !aodJets[0]){ 
-     aodJets[0] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[0].Data())); 
-     aodJets[1] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[1].Data()));  }
+   aodJets[0] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[0].Data())); 
+   aodJets[1] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[1].Data()));  }
 
-   Double_t ptsub[aodJets[0]->GetEntriesFast()];
-   Int_t inord[aodJets[0]->GetEntriesFast()];
-   for(Int_t n=0;n<aodJets[0]->GetEntriesFast();n++){
-     ptsub[n]=0;
-     inord[n]=0;}   
+   //Double_t ptsub[aodJets[0]->GetEntriesFast()];
+   //Int_t inord[aodJets[0]->GetEntriesFast()];
+   //for(Int_t n=0;n<aodJets[0]->GetEntriesFast();n++){
+   //  ptsub[n]=0;
+   //  inord[n]=0;}   
 
    TList ParticleList;
    Int_t nT = GetListOfTracks(&ParticleList);
      for (Int_t iJetType = 0; iJetType < 2; iJetType++) {
       fListJets[iJetType]->Clear();
       if (!aodJets[iJetType]) continue;
+
       if(fDebug) Printf("%s: %d jets",fJetBranchName[iJetType].Data(),aodJets[iJetType]->GetEntriesFast());
       
    
       for (Int_t iJet = 0; iJet < aodJets[iJetType]->GetEntriesFast(); iJet++) {
          AliAODJet *jet = dynamic_cast<AliAODJet*>((*aodJets[iJetType])[iJet]);
-        if(!jet)continue;
-          fListJets[iJetType]->Add(jet);
-         if(iJetType==0){
-          ptsub[iJet]=jet->Pt()-rho*jet->EffectiveAreaCharged();
-        }}}
+         if (jet) fListJets[iJetType]->Add(jet);
+        // if(iJetType==0){
+        // ptsub[iJet]=jet->Pt()-rho*jet->EffectiveAreaCharged();}
+      }}
    
    Double_t etabig=0;
    Double_t ptbig=0;
@@ -495,39 +521,21 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
    Double_t areasmall=0;
    //Double_t distr=0.;
    Double_t phismall=0.;
-   Int_t indexlead=-1;
-   Int_t indexsublead=-1;
-   Int_t indexstop=-1;
-  
-   if(fListJets[0]->GetEntries()>0) TMath::Sort(fListJets[0]->GetEntries(),ptsub,inord);
-
-   for(Int_t jj=0;jj<fListJets[0]->GetEntries();jj++){
-   AliAODJet* jetlead = (AliAODJet*)(fListJets[0]->At(inord[jj]));
-   if(jetlead->Pt()-rho*jetlead->EffectiveAreaCharged()<=0) continue;
-   if((jetlead->Eta()<fJetEtaMin)||(jetlead->Eta()>fJetEtaMax)) continue;
-   indexlead=inord[jj];
-   indexstop=jj;
-   break;}
-   if((indexstop>-1)&&(indexstop+1<fListJets[0]->GetEntries()-1)){
-   for(Int_t k=indexstop+1;k<fListJets[0]->GetEntries();k++){
-   AliAODJet* jetsublead = (AliAODJet*)(fListJets[0]->At(inord[k]));
-   if(jetsublead->Pt()-rho*jetsublead->EffectiveAreaCharged()<=0) continue;
-   if((jetsublead->Eta()<fJetEtaMin)||(jetsublead->Eta()>fJetEtaMax)) continue;
-   indexsublead=inord[k];
-   break;}}
          
   
-   Double_t up1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t up2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t up3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t up4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t down1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t down2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t down3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-   Double_t down4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
-    
-  
-
+   // Double_t up1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t up2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t up3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t up4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t down1[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t down2[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t down3[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   // Double_t down4[15]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
+   Int_t iCount=0; 
+   Int_t trigJet=-1;
+   Int_t trigBBTrack=-1;
+   Int_t trigInTrack=-1;
+     
    for(Int_t i=0; i<fListJets[0]->GetEntries(); ++i){
            AliAODJet* jetbig = (AliAODJet*)(fListJets[0]->At(i));
            etabig  = jetbig->Eta();
@@ -542,40 +550,35 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
                    Double_t ptmax=-10.; 
                    Int_t index1=-1;
                    Int_t index2=-1;
-                   //Double_t fracin=0.;
                   
-              Int_t point=GetHardestTrackBackToJet(jetbig);    
+               Int_t point=GetHardestTrackBackToJet(jetbig);    
               AliVParticle *partback = (AliVParticle*)ParticleList.At(point);                            
-                   if(!partback) continue; 
+               if(!partback) continue; 
                   fh3spectriggered->Fill(centValue,ptcorr,partback->Pt());
-                    Int_t  flaglead=0;
-                       if(i==indexlead) flaglead=1;
-                       if(i==indexsublead) flaglead=2;
-
-                      fh3specleadsublead->Fill(centValue,ptcorr,flaglead);
-
                        AliAODTrack* leadtrack; 
                        Int_t ippt=0;
                        Double_t ppt=-10;   
-
-                       TRefArray *genTrackList = jetbig->GetRefTracks();
-                        Int_t nTracksGenJet = genTrackList->GetEntriesFast();
-                        AliAODTrack* genTrack;
+                      TRefArray *genTrackList = jetbig->GetRefTracks();
+                       Int_t nTracksGenJet = genTrackList->GetEntriesFast();
+                       AliAODTrack* genTrack;
                        for(Int_t ir=0; ir<nTracksGenJet; ++ir){
                        genTrack = (AliAODTrack*)(genTrackList->At(ir));
                       if(genTrack->Pt()>ppt){ppt=genTrack->Pt();
-                        ippt=ir;}}
-                      //Float_t etr=genTrack->Eta();
-                       //Float_t phir=genTrack->Phi();
-                       //distr=(etr-etabig)*(etr-etabig)+(phir-phibig)*(phir-phibig);
-                       //distr=TMath::Sqrt(distr);
-                      //if(distr<=fRadioFrac){ fracin=fracin+genTrack->Pt();}}
+                      ippt=ir;}}
                         leadtrack=(AliAODTrack*)(genTrackList->At(ippt));
+                        if(!leadtrack) continue;
                         fh3specbiased->Fill(centValue,ptcorr,leadtrack->Pt());
-                       //fhnJetCoreMethod3->Fill(centValue,ptcorr,fracin/ptbig,partback->Pt(),flaglead);
-                      if(fCheckMethods){
-                 
-                for(Int_t j=0; j<fListJets[1]->GetEntries(); ++j){
+                        if(centValue<10)fh3spectot->Fill(ptcorr,leadtrack->Pt(),partback->Pt());
+                       //store one trigger info                   
+                        if((partback->Pt()>10.)&&(iCount==0)){                        
+                         trigJet=i;
+                          trigBBTrack=point;
+                          trigInTrack=ippt;
+                          iCount=iCount+1;} 
+
+
+                 if(fCheckMethods){
+                  for(Int_t j=0; j<fListJets[1]->GetEntries(); ++j){
                   AliAODJet* jetsmall = (AliAODJet*)(fListJets[1]->At(j));
                   etasmall  = jetsmall->Eta();
                   phismall = jetsmall->Phi();
@@ -602,128 +605,161 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
                  if((centValue>30)&&(centValue<60)) fh2JetCoreMethod2C30->Fill(ptcorr,jetmethod2->Pt()/ptbig);
                  if(centValue>60) fh2JetCoreMethod2C60->Fill(ptcorr,jetmethod2->Pt()/ptbig); }}  
 
-                  
-  
           for(int it = 0;it<nT;++it){
          AliVParticle *part = (AliVParticle*)ParticleList.At(it);
-         Double_t deltaR = jetbig->DeltaR(part);
+                 Double_t deltaR = jetbig->DeltaR(part);
           Double_t deltaEta = etabig-part->Eta();
           Double_t deltaPhi=phibig-part->Phi();
           if(deltaPhi<-0.5*TMath::Pi()) deltaPhi+=2.*TMath::Pi();
           if(deltaPhi>3./2.*TMath::Pi()) deltaPhi-=2.*TMath::Pi();
+                 Double_t jetEntries[8] = {centValue,ptcorr,part->Pt(),deltaR,deltaEta,deltaPhi,leadtrack->Pt(),partback->Pt()};                     fhnDeltaR->Fill(jetEntries);
+          }
+          //end of track loop
+          }
+          //end of jet loop
+
+
+
+
+          if(fDoEventMixing){
+            //check before if the trigger exists
+            // fTrigBuffer[i][0] = zvtx
+            // fTrigBuffer[i][1] = phi
+            // fTrigBuffer[i][2] = eta
+            // fTrigBuffer[i][3] = pt_jet
+            // fTrigBuffer[i][4] = pt_trig
+            // fTrigBuffer[i][5]= pt_track_in
+            // fTrigBuffer[i][6]= centrality
+           if(fTindex==11) fTindex=0;
+            if(fTrigBuffer[fTindex][3]>0){
+           if (TMath::Abs(fTrigBuffer[fTindex][0]-primVtx->GetZ()<2.)){
+           if (TMath::Abs(fTrigBuffer[fTindex][6]-centValue<10)){  
+             
+                        for(int it = 0;it<nT;++it){
+                       AliVParticle *part = (AliVParticle*)ParticleList.At(it);                        Double_t DPhi = fTrigBuffer[fTindex][1] - part->Phi();
+                        Double_t DEta = fTrigBuffer[fTindex][2] - part->Eta();
+                        Double_t DR=TMath::Sqrt(DPhi*DPhi+DEta*DEta);
+                        if(DPhi<-0.5*TMath::Pi()) DPhi+=2.*TMath::Pi();
+                        if(DPhi>3./2.*TMath::Pi()) DPhi-=2.*TMath::Pi();
+                        Double_t triggerEntries[8] = {centValue,fTrigBuffer[fTindex][3],part->Pt(),DR,DEta,DPhi,fTrigBuffer[fTindex][4],fTrigBuffer[fTindex][5]};                      
+                        fhnMixedEvents->Fill(triggerEntries);
+                        }
+                        fNevents=fNevents+1;  
+                        if(fNevents==9) {fTindex=fTindex+1;
+                       fNevents=0;} 
+           }}}
+        
+
+               // Copy the triggers from the current event into the buffer.
+               //again, only if the trigger exists:
+               if(trigJet>-1){
+                AliAODJet* jetT = (AliAODJet*)(fListJets[0]->At(trigJet));                 
+                AliVParticle *partL = (AliVParticle*)ParticleList.At(trigInTrack);
+                AliVParticle *partT = (AliVParticle*)ParticleList.At(trigBBTrack);         
+                fTrigBuffer[fTrigBufferIndex][0] = primVtx->GetZ();
+                fTrigBuffer[fTrigBufferIndex][1] = jetT->Phi();
+                fTrigBuffer[fTrigBufferIndex][2] = jetT->Eta();
+                fTrigBuffer[fTrigBufferIndex][3] = jetT->Pt()-rho*jetT->EffectiveAreaCharged();
+                fTrigBuffer[fTrigBufferIndex][4] = partT->Pt();
+                fTrigBuffer[fTrigBufferIndex][5] = partL->Pt();
+                fTrigBuffer[fTrigBufferIndex][6] = centValue;
+                fTrigBufferIndex++;
+               if(fTrigBufferIndex==9) fTrigBufferIndex=0;
+               }
+         }
+         
+
+
+
 
-                 Double_t jetEntries[9] = {centValue,ptcorr,part->Pt(),deltaR,deltaEta,deltaPhi,flaglead,leadtrack->Pt(),partback->Pt()};            fhnDeltaR->Fill(jetEntries);
-         }  
-     //end of track loop
-   
-     //fhnSumBkg->Fill(centValue,ptcorr,bkg/jetbig->Pt(),partback->Pt(),flaglead);       
-   
-   
      //////////////////ANGULAR STRUCTURE//////////////////////////////////////
 
      //tracks up to R=0.8 distant from the jet axis
-     if(fAngStructCloseTracks==1){
-      TList CloseTrackList;
-      Int_t nn=GetListOfTracksCloseToJet(&CloseTrackList,jetbig);
-      Double_t difR=0.04;
-      for(Int_t l=0;l<15;l++){
-      Double_t rr=l*0.1+0.1;
-       for(int it = 0;it<nn;++it){
-           AliVParticle *part1 = (AliVParticle*)CloseTrackList.At(it);
-           for(int itu=it+1;itu<CloseTrackList.GetEntries();itu++){      
-           AliVParticle *part2 = (AliVParticle*)CloseTrackList.At(itu);  
-           Double_t ptm=part1->Pt();
-           Double_t ptn=part2->Pt();   
-           Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
-                      Rnm=TMath::Sqrt(Rnm);
-                      Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));      
-                      Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR)));
-                      if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                       down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
-                      if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                       down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
-                      if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                        down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
-                      if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
-                       down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}
-     }
+   //   if(fAngStructCloseTracks==1){
+   //    TList CloseTrackList;
+   //    Int_t nn=GetListOfTracksCloseToJet(&CloseTrackList,jetbig);
+   //    Double_t difR=0.04;
+   //    for(Int_t l=0;l<15;l++){
+   //    Double_t rr=l*0.1+0.1;
+   //     for(int it = 0;it<nn;++it){
+   //         AliVParticle *part1 = (AliVParticle*)CloseTrackList.At(it);
+   //         for(int itu=it+1;itu<CloseTrackList.GetEntries();itu++){      
+   //         AliVParticle *part2 = (AliVParticle*)CloseTrackList.At(itu);  
+   //         Double_t ptm=part1->Pt();
+   //         Double_t ptn=part2->Pt();        
+   //         Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
+   //                    Rnm=TMath::Sqrt(Rnm);
+   //                    Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));      
+   //                    Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR)));
+   //                    if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                  down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
+   //                    if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                  down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
+   //                    if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                   down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
+   //                    if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                  down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}
+   //   }
     
-     //only jet constituents
-      if(fAngStructCloseTracks==2){
+   //   //only jet constituents
+   //    if(fAngStructCloseTracks==2){
 
-      Double_t difR=0.04;
-      for(Int_t l=0;l<15;l++){
-      Double_t rr=l*0.1+0.1;
+   //    Double_t difR=0.04;
+   //    for(Int_t l=0;l<15;l++){
+   //    Double_t rr=l*0.1+0.1;
 
     
-      AliAODTrack* part1;
-      AliAODTrack* part2;
+   //    AliAODTrack* part1;
+   //    AliAODTrack* part2;
 
-          TRefArray *genTrackListb = jetbig->GetRefTracks();
-          Int_t nTracksGenJetb = genTrackListb->GetEntriesFast();
+   //        TRefArray *genTrackListb = jetbig->GetRefTracks();
+   //        Int_t nTracksGenJetb = genTrackListb->GetEntriesFast();
           
              
 
-          for(Int_t it=0; it<nTracksGenJetb; ++it){
-             part1 = (AliAODTrack*)(genTrackListb->At(it));
-           for(Int_t itu=0; itu<nTracksGenJetb; ++itu){
-             part2 = (AliAODTrack*)(genTrackListb->At(itu));
-           Double_t ptm=part1->Pt();
-           Double_t ptn=part2->Pt();   
-           Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
-                      Rnm=TMath::Sqrt(Rnm);
-                      Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));
-                      Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR))); 
-                      if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                       down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
-                      if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                       down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
-                      if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
-                                                        down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
-                      if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
-                       down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}}
-
-
-   
-
-
-
-
-
-
-
-
-
-
-
-
-   }
-
-
-     //end loop over R=0.4 jets        
-     if(fAngStructCloseTracks>0){
-     for(Int_t l=0;l<15;l++){
-     Double_t rr=l*0.1+0.1;
-        if(down1[l]!=0){  
-       if(centValue<10.)fh2AngStructpt1C10->Fill(rr,rr*up1[l]/down1[l]);
-        if(centValue>20. && centValue<40.) fh2AngStructpt1C20->Fill(rr,rr*up1[l]/down1[l]);
-        if(centValue>30. && centValue<60.) fh2AngStructpt1C30->Fill(rr,rr*up1[l]/down1[l]);
-        if(centValue>60.) fh2AngStructpt1C60->Fill(rr,rr*up1[l]/down1[l]);}
-        if(down2[l]!=0){  
-       if(centValue<10.) fh2AngStructpt2C10->Fill(rr,rr*up2[l]/down2[l]);
-        if(centValue>20. && centValue<40.) fh2AngStructpt2C20->Fill(rr,rr*up2[l]/down2[l]);
-        if(centValue>30. && centValue<60.) fh2AngStructpt2C30->Fill(rr,rr*up2[l]/down2[l]);
-        if(centValue>60.) fh2AngStructpt2C60->Fill(rr,rr*up2[l]/down2[l]);}
-        if(down3[l]!=0){  
-       if(centValue<10.) fh2AngStructpt3C10->Fill(rr,rr*up3[l]/down3[l]);
-        if(centValue>20. && centValue<40.) fh2AngStructpt3C20->Fill(rr,rr*up3[l]/down3[l]);
-        if(centValue>30. && centValue<60.) fh2AngStructpt3C30->Fill(rr,rr*up3[l]/down3[l]);
-        if(centValue>60.) fh2AngStructpt3C60->Fill(rr,rr*up3[l]/down3[l]);}
-        if(down4[l]!=0){  
-       if(centValue<10.) fh2AngStructpt4C10->Fill(rr,rr*up4[l]/down4[l]);
-        if(centValue>20. && centValue<40.) fh2AngStructpt4C20->Fill(rr,rr*up4[l]/down4[l]);
-        if(centValue>30. && centValue<60.) fh2AngStructpt4C30->Fill(rr,rr*up4[l]/down4[l]);
-        if(centValue>60.) fh2AngStructpt4C60->Fill(rr,rr*up4[l]/down4[l]);}}}
+   //        for(Int_t it=0; it<nTracksGenJetb; ++it){
+   //           part1 = (AliAODTrack*)(genTrackListb->At(it));
+   //         for(Int_t itu=0; itu<nTracksGenJetb; ++itu){
+   //           part2 = (AliAODTrack*)(genTrackListb->At(itu));
+   //         Double_t ptm=part1->Pt();
+   //         Double_t ptn=part2->Pt();        
+   //         Double_t Rnm = (part1->Eta()-part2->Eta())*(part1->Eta()-part2->Eta())+(part1->Phi()-part2->Phi())*(part1->Phi()-part2->Phi());
+   //                    Rnm=TMath::Sqrt(Rnm);
+   //                    Double_t deltag=(1./(TMath::Sqrt(2*TMath::Pi())*difR))*TMath::Exp(-1.*(rr-Rnm)*(rr-Rnm)/(2.*difR*difR));
+   //                    Double_t stepf=0.5*(1.+TMath::Erf((rr-Rnm)/(TMath::Sqrt(2.)*difR))); 
+   //                    if((ptcorr<85.) && (ptcorr>=70.)){up1[l]=up1[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                  down1[l]=down1[l]+ptm*ptn*Rnm*Rnm*stepf;}
+   //                    if((ptcorr<100.) && (ptcorr>=85.)){up2[l]=up2[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                  down2[l]=down2[l]+ptm*ptn*Rnm*Rnm*stepf;}  
+   //                    if((ptcorr<120.) && (ptcorr>=100.)){up3[l]=up3[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                                                   down3[l]=down3[l]+ptm*ptn*Rnm*Rnm*stepf;}
+   //                    if((ptcorr<140.) && (ptcorr>=120.)){up4[l]=up4[l]+ptm*ptn*Rnm*Rnm*deltag;
+   //                  down4[l]=down4[l]+ptm*ptn*Rnm*Rnm*stepf;}}}}}
+   // }
+     // //end loop over R=0.4 jets     
+     // if(fAngStructCloseTracks>0){
+     // for(Int_t l=0;l<15;l++){
+     // Double_t rr=l*0.1+0.1;
+     //    if(down1[l]!=0){  
+     //        if(centValue<10.)fh2AngStructpt1C10->Fill(rr,rr*up1[l]/down1[l]);
+     //    if(centValue>20. && centValue<40.) fh2AngStructpt1C20->Fill(rr,rr*up1[l]/down1[l]);
+     //    if(centValue>30. && centValue<60.) fh2AngStructpt1C30->Fill(rr,rr*up1[l]/down1[l]);
+     //    if(centValue>60.) fh2AngStructpt1C60->Fill(rr,rr*up1[l]/down1[l]);}
+     //    if(down2[l]!=0){  
+     //        if(centValue<10.) fh2AngStructpt2C10->Fill(rr,rr*up2[l]/down2[l]);
+     //    if(centValue>20. && centValue<40.) fh2AngStructpt2C20->Fill(rr,rr*up2[l]/down2[l]);
+     //    if(centValue>30. && centValue<60.) fh2AngStructpt2C30->Fill(rr,rr*up2[l]/down2[l]);
+     //    if(centValue>60.) fh2AngStructpt2C60->Fill(rr,rr*up2[l]/down2[l]);}
+     //    if(down3[l]!=0){  
+     //        if(centValue<10.) fh2AngStructpt3C10->Fill(rr,rr*up3[l]/down3[l]);
+     //    if(centValue>20. && centValue<40.) fh2AngStructpt3C20->Fill(rr,rr*up3[l]/down3[l]);
+     //    if(centValue>30. && centValue<60.) fh2AngStructpt3C30->Fill(rr,rr*up3[l]/down3[l]);
+     //    if(centValue>60.) fh2AngStructpt3C60->Fill(rr,rr*up3[l]/down3[l]);}
+     //    if(down4[l]!=0){  
+     //        if(centValue<10.) fh2AngStructpt4C10->Fill(rr,rr*up4[l]/down4[l]);
+     //    if(centValue>20. && centValue<40.) fh2AngStructpt4C20->Fill(rr,rr*up4[l]/down4[l]);
+     //    if(centValue>30. && centValue<60.) fh2AngStructpt4C30->Fill(rr,rr*up4[l]/down4[l]);
+     //    if(centValue>60.) fh2AngStructpt4C60->Fill(rr,rr*up4[l]/down4[l]);}}}
 
     
 
@@ -768,7 +804,7 @@ Int_t  AliAnalysisTaskJetCore::GetListOfTracks(TList *list){
       iCount++;
     }
   
-   list->Sort();
+   
   return iCount;
  
 }
@@ -787,7 +823,7 @@ Int_t  AliAnalysisTaskJetCore::GetListOfTracks(TList *list){
       if(TMath::Abs(tr->Eta())>0.9)continue;
       if(tr->Pt()<0.15)continue;
       iCount=iCount+1;
-      dphi=RelativePhi(tr->Phi(),jetbig->Phi());   
+      dphi=RelativePhi(tr->Phi(),jetbig->Phi());  
       if(TMath::Abs(dphi)<TMath::Pi()-0.2) continue;
       if(tr->Pt()>ptmax){ ptmax=tr->Pt();
        index=iCount;
@@ -951,19 +987,21 @@ void AliAnalysisTaskJetCore::GetDimParams(Int_t iEntry, TString &label, Int_t &n
    case 2:
       label = "track pT";
      
-      nbins = 50;
+         nbins = 1000;
          xmin = 0.;
          xmax = 50;
          break;
       
       
-   case 3:
+    case 3:
       label = "deltaR";
       nbins = 15;
       xmin = 0.;
       xmax = 1.5;
       break;
-      
+
+
+
    case 4:
       label = "deltaEta";
       nbins = 30;
@@ -980,30 +1018,29 @@ void AliAnalysisTaskJetCore::GetDimParams(Int_t iEntry, TString &label, Int_t &n
       break;   
    
       
-   case 6:
-      label="flagleadname";
-      nbins=3;
-      xmin=0;
-      xmax=3;
-      break;
-
-    case 7:
-    
+        
+    case 6:
       label = "leading track";
       nbins = 50;
       xmin = 0;
       xmax = 50;
       break;
            
-     case 8:
+     case 7:
     
       label = "trigger track";
       nbins =50;
       xmin = 0;
       xmax = 50;
       break;
-      
-        
+
+
+   
+  
+
+
+
+
    }
 
 }
index ccf873c..da4690f 100644 (file)
@@ -75,6 +75,7 @@ public:
    virtual void     SetNInputTracksMax(Int_t nTr) { fNInputTracksMax = nTr; }
    virtual void     SetAngStructCloseTracks(Int_t yesno){fAngStructCloseTracks=yesno;}
    virtual void     SetCheckMethods(Int_t yesno){fCheckMethods=yesno;}
+   virtual void     SetEventMixing(Int_t yesno){fDoEventMixing=yesno;}
    virtual void     SetJetEtaMin(Float_t eta) { fJetEtaMin = eta; }
    virtual void     SetJetEtaMax(Float_t eta) { fJetEtaMax = eta; }
    virtual void     SetJetPtMin(Float_t pt) { fJetPtMin = pt; }
@@ -83,7 +84,7 @@ public:
    virtual void     SetNMatchJets(Int_t n) { fNMatchJets = n; }
    virtual void     SetFillEvent(Bool_t b) { fbEvent = b; }
    virtual void     SetKeepJets(Bool_t b = kTRUE) { fKeepJets = b; }
-   virtual void SetNonStdFile(char* c){fNonStdFile = c;} 
+   virtual void     SetNonStdFile(char* c){fNonStdFile = c;} 
 
 
 private:
@@ -116,10 +117,14 @@ private:
    Int_t   fNInputTracksMin;  // lower bound of nb. of input tracks
    Int_t   fNInputTracksMax;  // upper bound of nb. of input tracks
    Int_t   fAngStructCloseTracks;//only constituents or all tracks with R<0.8 for the angular structure
-   Int_t fCheckMethods;     //to look into more detail into the core
-   Float_t fJetEtaMin;     // lower bound on eta for found jets
-   Float_t fJetEtaMax;     // upper bound on eta for found jets
-   Float_t fJetPtMin;      // minimum jet pT
+   Int_t   fCheckMethods;     //to look into more detail into the core
+   Int_t   fDoEventMixing;
+   Float_t fJetEtaMin;        // lower bound on eta for found jets
+   Float_t fJetEtaMax;        // upper bound on eta for found jets
+   Int_t   fNevents;          // number of events
+   Int_t   fTindex;           // index reference
+   Int_t   fTrigBufferIndex;  //index for the buffering
+   Float_t fJetPtMin;         // minimum jet pT
    UChar_t fJetTriggerExcludeMask; // mask for jet triggeres to exclude
    Float_t fJetPtFractionMin; // minimum fraction for positiv match of jets
    Int_t   fNMatchJets;       // maximal nb. of jets taken for matching
@@ -135,8 +140,8 @@ private:
    Bool_t fbEvent;                            // fill fhnEvent
    TH1I  *fHistEvtSelection;                  //! event selection statistic
    THnSparse *fhnDeltaR;                     //! variables per jet
-   THnSparse *fhnSumBkg;               //! variables per jet before acceptance cut
-   THnSparse *fhnJetCoreMethod3;               //! variables per jet before acc     
+   THnSparse *fhnMixedEvents;                //!mixed events matrix
 
    TH2F      *fh2JetCoreMethod1C10;          //Energy fraction in the core C10 method 1
    TH2F      *fh2JetCoreMethod2C10;          //Energy fraction in the core C10 method 2
@@ -165,8 +170,8 @@ private:
      TH2F*      fh2AngStructpt4C60;         //C60 pt4
      TH3F*      fh3spectriggered;           //triggered spectra
      TH3F*      fh3specbiased;              //biased spectra
-     TH3F*      fh3specleadsublead;         //lead/sublead/all spectra
-   
+     TH3F*      fh3spectot;                 //the two combined    
+     Double_t            fTrigBuffer[10][7];      //!buffer for triggers   
 
    AliAnalysisTaskJetCore(const AliAnalysisTaskJetCore&); // not implemented
    AliAnalysisTaskJetCore& operator=(const AliAnalysisTaskJetCore&); // not implemented