Fork me on GitHub

Changeset 290 in svn


Ignore:
Timestamp:
Mar 3, 2009, 12:48:15 AM (16 years ago)
Author:
Xavier Rouby
Message:

tracks and Taujets have charge

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r270 r290  
    318318  vector<fastjet::PseudoJet> input_particles;//for FastJet algorithm
    319319  vector<fastjet::PseudoJet> sorted_jets;
    320   vector<TLorentzVector> TrackCentral; 
     320  //vector<TLorentzVector> TrackCentral; 
     321  vector<TRootTracks> TrackCentral; 
    321322  vector<PhysicsTower> towers;
    322323  //vector<ParticleUtil> electron;
     
    326327  //vector<ParticleUtil> gamma;
    327328  vector<D_Particle> gamma;
     329
     330bool FLAG_lhco = true;
    328331
    329332  TSimpleArray<TRootGenParticle> NFCentralQ;
     
    489492                   if( (rand()%100) < DET->TRACK_eff && sET!=0) {
    490493                     elementTrack = (TRootTracks*) branchTrack->NewEntry();
    491                      elementTrack->Set(particle->Eta, particle->Phi, particle->EtaCalo, particle->PhiCalo, sET);
    492                      TrackCentral.push_back(elementTrack->GetFourVector()); // tracks at vertex!
    493                      // TODO!!! associates the tracks to the calo where it points to
     494                     elementTrack->Set(particle->Eta, particle->Phi, particle->EtaCalo, particle->PhiCalo, sET, particle->Charge);
     495                     //TrackCentral.push_back(elementTrack->GetFourVector()); // tracks at vertex!
     496                     TrackCentral.push_back(*elementTrack); // tracks at vertex!
    494497                     // TODO!!! apply a smearing on the position of the origin of the track
    495498                     // TODO!!! elementTracks->SetPositionOut(Xout,Yout,Zout);
     
    577580        elementElec->Charge = sign(electron[i].PID());
    578581        elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0);//isolation based on tracks
    579       }
     582      }                                                                                 /////////////// HARDCODING
    580583      DET->SortedVector(muon);
    581584      for(unsigned int i=0; i < muon.size(); i++) {
     
    585588        elementMu->EtaCalo = muon[i].EtaCalo();
    586589        elementMu->PhiCalo = muon[i].PhiCalo();
    587         elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,2.0);
     590        elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,2.0); /////////////// HARDCODING
    588591      }
    589592      DET->SortedVector(gamma);
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r278 r290  
    289289//---------------------------------------------------------------------------
    290290
    291 class TRootTracks : public TRootParticle {
     291class TRootTracks : public TSortableObject {
    292292 public:
    293293    TRootTracks(); // needed for storage in ExRootAnalysis
     
    295295    TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
    296296    TRootTracks& operator=(const TRootTracks& track);
    297     void Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
     297    void Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge);
    298298    const TLorentzVector GetFourVector() const;
    299    // const float getEta() const {return Eta;}
    300    // const float getPhi() const {return Phi;}
    301    // const float getEtaOuter() const {return EtaOuter;}
    302    // const float getPhiOuter() const {return PhiOuter;}
     299    const float getEta() const {return Eta;}
     300    const float getPhi() const {return Phi;}
     301    const float getEtaOuter() const {return EtaOuter;}
     302    const float getPhiOuter() const {return PhiOuter;}
    303303
    304304    static TCompare *fgCompare; //!
    305     //const TCompare *GetCompare() const { return fgCompare; }
    306 
    307 //    float Eta, Phi; // (eta,phi) at the beginning of the track
     305    const TCompare *GetCompare() const { return fgCompare; }
     306
     307    float Eta, Phi; // (eta,phi) at the beginning of the track
    308308    float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
    309 //    float PT, E, Px, Py, Pz;  // transverse momentum
     309    float PT, E, Px, Py, Pz;  // transverse momentum
     310    float Charge;
    310311 ClassDef(TRootTracks, 1)
    311312};
     
    352353public:
    353354  TRootTauJet() {};
     355  float Charge; // normally, using the charge of the track ; here using gen-level tau charge
    354356
    355357//  float E;  // particle energy in GeV
  • trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc

    r278 r290  
    126126}
    127127
    128     float Eta, Phi; // (eta,phi) at the beginning of the track
     128/*    float Eta, Phi; // (eta,phi) at the beginning of the track
    129129    float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
    130     float PT, E, Px, Py, Pz;
     130    float PT, E, Px, Py, Pz; */
    131131
    132132TRootTracks::TRootTracks() :
    133         TRootParticle(),
    134         EtaOuter(UNDEFINED), PhiOuter(UNDEFINED) {}
    135 /*        Eta = UNDEFINED;
    136         Phi = UNDEFINED;
    137         PT = UNDEFINED;
    138         E = UNDEFINED;
    139         Px = UNDEFINED;
    140         Py = UNDEFINED;
    141         Pz = UNDEFINED;
    142 
    143 }*/
     133        Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
     134        PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED),
     135        Charge(UNDEFINED) {}
    144136
    145137TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
    146         EtaOuter(outEta), PhiOuter(outPhi) {
    147         Eta = inEta;
    148         Phi = inPhi;
    149         PT = pt;
     138        Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
     139        PT(pt) {
    150140        TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
    151141        Px = p.Px(); Py = p.Py(); Pz = p.Pz();  E=p.E();
     142        Charge = UNDEFINED;
    152143}
    153144TRootTracks::TRootTracks(const TRootTracks& track) :
    154         EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter)
    155         {
    156           Eta = track.Eta;
    157           Phi = track.Phi;
    158           PT = track.PT;
    159           E = track.E;
    160           Px = track.Px;
    161           Py = track.Py;
    162           Pz = track.Pz;
    163         }
     145        Eta(track.Eta), Phi(track.Phi),
     146        EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
     147        PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz), Charge(track.Charge) {}
    164148
    165149TRootTracks& TRootTracks::operator=(const TRootTracks& track) {
     
    168152        EtaOuter = track.EtaOuter;   PhiOuter = track.PhiOuter;
    169153        PT = track.PT; E = track.E;  Px = track.Px;  Py= track.Py; Pz =track.Pz;
     154        Charge = track.Charge;
    170155  return *this;
    171156}
    172157
    173 void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) {
     158void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge) {
    174159        Eta= inEta; Phi=inPhi;  EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
    175160        TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
    176161        Px = p.Px(); Py = p.Py(); Pz = p.Pz();  E=p.E();
     162        Charge = charge;
    177163}
    178164
Note: See TracChangeset for help on using the changeset viewer.