]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALJetFinder.cxx
Bending radius correctly in cm.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetFinder.cxx
index 7d5699c3ccd06baa4b9999e78829fb39d8ba69a8..efd01b050cc67b8c7d0087f4b675c28aba5a7e70 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
 
 /*
 $Log$
+Revision 1.6  2002/01/21 12:53:50  morsch
+authors
+
+Revision 1.5  2002/01/21 12:47:47  morsch
+Possibility to include K0long and neutrons.
+
+Revision 1.4  2002/01/21 11:03:21  morsch
+Phi propagation introduced in FillFromTracks.
+
+Revision 1.3  2002/01/18 05:07:56  morsch
+- hadronic correction
+- filling of digits
+- track selection upon EMCAL information
+
 */
 
-//*-- Author: Andreas Morsch (CERN)
-//*           J.L. Klay      (LBL)
+//*-- Authors: Andreas Morsch   (CERN)
+//*            J.L. Klay        (LBL)
+//*            Aleksei Pavlinov (WSU) 
+
 // From root ...
 #include <TClonesArray.h>
 #include <TTree.h>
@@ -39,8 +56,11 @@ $Log$
 #include "AliEMCALHadronCorrection.h"
 #include "Ecommon.h"
 #include "AliRun.h"
+#include "AliMagF.h"
+#include "AliMagFCM.h"
 #include "AliEMCAL.h"
 #include "AliHeader.h"
+#include "AliPDG.h"
 
 ClassImp(AliEMCALJetFinder)
 
@@ -77,12 +97,14 @@ AliEMCALJetFinder::AliEMCALJetFinder(const char* name, const char *title)
     fEtaT      = 0;
     fPhiT      = 0;
     fHadronCorrector = 0;
+//
     SetPtCut();
     SetMomentumSmearing();
     SetEfficiencySim();
     SetDebug();
     SetHadronCorrection();
     SetSamplingFraction();
+    SetIncludeK0andN();
 }
 
 
@@ -452,10 +474,19 @@ void AliEMCALJetFinder::FillFromTracks(Int_t flag, Int_t ich)
 
        if (part < 2) continue;
        if (pT == 0 || pT < fPtCut) continue;
+       TParticlePDG* pdgP = 0;
 // charged or neutral 
        if (ich == 0) {
-           TParticlePDG* pdgP = MPart->GetPDG();
-           if (pdgP->Charge() == 0) continue;
+           pdgP = MPart->GetPDG();
+           if (pdgP->Charge() == 0) {
+               if (!fK0N) {
+                   continue;
+               } else {
+                   if (mpart != kNeutron    &&
+                       mpart != kNeutronBar &&
+                       mpart != kK0Long) continue;
+               }
+           }
        } 
 // skip partons
        if (TMath::Abs(mpart) <= 6         ||
@@ -471,6 +502,14 @@ void AliEMCALJetFinder::FillFromTracks(Int_t flag, Int_t ich)
        printf("\n sel:%5d %5d %5d %8.2f %8.2f %8.2f",
        part, mpart, child1, eta, phi, pT);
 //
+//
+// phi propagation 
+
+       Bool_t curls = kFALSE;
+       Float_t dphi = PropagatePhi(pT, pdgP->Charge(), curls);
+       if (curls) continue;
+       phi += dphi;
+//
 // Momentum smearing goes here ...
 //
        if (fSmear) {
@@ -866,6 +905,37 @@ void AliEMCALJetFinder::FindTracksInJetCone()
     } // jet loop loop
 }
 
+Float_t AliEMCALJetFinder::PropagatePhi(Float_t pt, Float_t charge, Bool_t& curls)
+{
+// Propagates phi angle to EMCAL radius
+//
+    Float_t dPhi = 0.;
+// Get field
+    Float_t b =  ((AliMagFCM*) gAlice->Field())->SolenoidField();
+// Get EMCAL radius 
+    Float_t rEMCAL = AliEMCALGeometry::GetInstance()->GetIPDistance();
+//
+//
+// bending radies
+    Float_t rB = 333.56 * pt / b;
+    
+//
+// check if particle is curling below EMCAL
+    if (2.*rB < rEMCAL) {
+       curls = kTRUE;
+       return dPhi;
+    }
+//
+// if not calculate delta phi
+    Float_t phi = TMath::ACos(1.-rEMCAL*rEMCAL/(2.*rB*rB));
+    dPhi = TMath::ATan2(1.-TMath::Cos(phi), TMath::Sin(phi));
+    dPhi = TMath::Sign(dPhi, charge);
+//    
+    return dPhi;
+    
+}
+
+
 void hf1(Int_t& id, Float_t& x, Float_t& wgt)
 {
 // dummy for hbook calls