Fork me on GitHub

Changeset 270 in svn


Ignore:
Timestamp:
Feb 14, 2009, 2:06:20 AM (16 years ago)
Author:
severine ovyn
Message:

remove double GEN pfff

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r268 r270  
    385385      // 2.1a Loop over all particles in event, to fill the towers
    386386      itGen.Reset();
    387       TRootGenParticle *particle;
    388       while( (particle = (TRootGenParticle*) itGen.Next()) ) {
    389           int pid = abs(particle->PID);
    390           particle->Charge=Charge(pid);
    391           particle->setFractions(); // init
     387      GenParticle *particleG;
     388      while( (particleG = (GenParticle*) itGen.Next()) ) {
     389
     390      TRootGenParticle *particle = new TRootGenParticle(particleG);
     391      int pid = abs(particle->PID);
     392      particle->Charge=ChargeVal(particle->PID);
     393      particle->setFractions(); // init
    392394
    393395
     
    407409            // 2.1a.2.1 Central solenoidal magnetic field
    408410            TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo
    409 
    410411            // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ?
    411412            // first checks if the charged particles reach the calo!
    412413            if( DET->FLAG_bfield ||
    413                 particle->getCharge()==0 ||
    414                 (!DET->FLAG_bfield && particle->getCharge()!=0 && particle->PT > DET->TRACK_ptmin))
     414                particle->Charge==0 ||
     415                (!DET->FLAG_bfield && particle->Charge!=0 && particle->PT > DET->TRACK_ptmin))
    415416            if(
    416417                (particle->EtaCalo > list_of_calorimeters.getEtamin() ) &&
     
    434435            // if bfield not simulated, pt should be high enough to be taken into account
    435436            // it is supposed here that DET->MAX_calo > DET->CEN_max_tracker > DET->CEN_max_mu > 0
    436             if( particle->getCharge() !=0 &&
     437            if( particle->Charge !=0 &&
    437438                fabs(particle->EtaCalo)< DET->CEN_max_tracker && // stays in the tracker -> track available
    438439               ( DET->FLAG_bfield ||
     
    447448
    448449                   // 2.1a.2.3.2 Muons
    449                    if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu && particle->PT > DET->PTCUT_muon ) {
     450                   if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu) {
    450451                        TLorentzVector p;
    451452                        float sPT = gRandom->Gaus(particle->PT, DET->MU_SmearPt*particle->PT );
     
    518519
    519520          } // 2.1a.2 : if visible particle
     521        delete particle;
    520522      } // loop on all particles 2.1a
    521523       
     
    589591        elementPhoton = (TRootPhoton*) branchPhoton->NewEntry();
    590592        elementPhoton->Set(gamma[i].Px(),gamma[i].Py(),gamma[i].Pz(),gamma[i].E());
    591         elementPhoton->EtaCalo = gamma[i].EtaCalo();
    592         elementPhoton->PhiCalo = gamma[i].PhiCalo();
    593593      }
    594594     
  • trunk/Examples/src/Analysis_Ex.cc

    r264 r270  
    145145      //*****************************************************
    146146      TIter itGen((TCollection*)GEN);
    147       TRootGenParticle *gen;
     147      GenParticle *gen;
    148148      itGen.Reset();
    149       while( (gen = (TRootGenParticle*) itGen.Next()) )
     149      while( (gen = (GenParticle*) itGen.Next()) )
    150150        {
    151151          PID      = gen->PID;      // particle HEP ID number
     
    155155          D1       = gen->D1;       // particle 1st daughter
    156156          D2       = gen->D2;       // particle 2nd daughter
    157           Charge = gen->getCharge();   // electrical charge
     157          Charge = gen->Charge;   // electrical charge
    158158         
    159159          T      = gen->T;        // particle vertex position (t component)
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r268 r270  
    164164  float Phi; // particle azimuthal angle in rad
    165165
    166   float EtaCalo; // particle pseudorapidity when entering the calo,
    167   float PhiCalo; // particle azimuthal angle in rad when entering the calo
    168 
    169166  void Set(const TLorentzVector& momentum);
    170167  void Set(const float px, const float py, const float pz, const float e);
    171168  void SetEtaPhi(const float eta, const float phi) {Eta=eta; Phi=phi;};
    172   void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
    173169  void SetEtaPhiEET(const float eta, const float phi, const float e, const float et);
    174170  static TCompare *fgCompare; //!
     
    179175};
    180176
    181 
    182 //---------------------------------------------------------------------------
    183 
    184 class TRootGenParticle: public TRootParticle {
    185 
    186 public:
    187   TRootGenParticle() {_initialised=false;}
     177//--------------------------------------------------------------------------
     178
     179class GenParticle: public TRootParticle {
     180
     181public:
     182  GenParticle() {};
    188183  int PID; // particle HEP ID number [RawHepEventParticle::pid()]
    189184  int Status; // particle status [RawHepEventParticle::status()]
     
    193188  int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
    194189
     190  float Charge;
     191
     192  float T; // particle vertex position (t component) [RawHepEventParticle::t()]
     193  float X; // particle vertex position (x component) [RawHepEventParticle::x()]
     194  float Y; // particle vertex position (y component) [RawHepEventParticle::y()]
     195  float Z; // particle vertex position (z component) [RawHepEventParticle::z()]
     196  float M;
     197 
     198
     199  static TCompare *fgCompare; //!
     200 
     201  ClassDef(GenParticle, 1)
     202};
     203
     204//---------------------------------------------------------------------------
     205
     206class TRootGenParticle: public TRootParticle {
     207
     208public:
     209  TRootGenParticle() {_initialised=false;}
     210  TRootGenParticle(GenParticle* part);
     211
     212  int PID; // particle HEP ID number [RawHepEventParticle::pid()]
     213  int Status; // particle status [RawHepEventParticle::status()]
     214  int M1; // particle 1st mother [RawHepEventParticle::mother1() - 1]
     215  int M2; // particle 2nd mother [RawHepEventParticle::mother2() - 1]
     216  int D1; // particle 1st daughter [RawHepEventParticle::daughter1() - 1]
     217  int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
     218
    195219  float T; // particle vertex position (t component) [RawHepEventParticle::t()]
    196220  float X; // particle vertex position (x component) [RawHepEventParticle::x()]
     
    199223  float M;
    200224  void setFractions();
    201   const float getCharge() const {return Charge;};
    202225  const float getFem()  {if(!_initialised) setFractions(); return _Fem;}
    203226  const float getFhad() {if(!_initialised) setFractions(); return _Fhad;}
    204227
     228  float EtaCalo; // particle pseudorapidity when entering the calo,
     229  float PhiCalo; // particle azimuthal angle in rad when entering the calo
     230  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
     231
     232  static TCompare *fgCompare; //!
     233
    205234  float Charge;      // electrical charge
    206 
    207   static TCompare *fgCompare; //!
    208235 protected:
    209236  float _Fem, _Fhad; // fractions of energy deposit
     
    222249  static TCompare *fgCompare; //!
    223250
     251  float EtaCalo; // particle pseudorapidity when entering the calo,
     252  float PhiCalo; // particle azimuthal angle in rad when entering the calo
     253  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
     254
    224255  bool IsolFlag;
    225256
     
    247278  int Charge; // particle Charge [RawHepEventParticle::pid()]
    248279  bool IsolFlag;
     280  float EtaCalo; // particle pseudorapidity when entering the calo,
     281  float PhiCalo; // particle azimuthal angle in rad when entering the calo
     282  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
     283
    249284  static TCompare *fgCompare; //!
    250285
  • trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc

    r268 r270  
    3636
    3737TCompare *TRootGenParticle::fgCompare = 0;
     38TCompare *GenParticle::fgCompare = 0;
    3839TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
    3940TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
     
    9091   Px = PT*cos(Phi);
    9192   Py = PT*sin(Phi);
     93}
     94
     95TRootGenParticle::TRootGenParticle(GenParticle* part) :
     96PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2),
     97T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){
     98    E=part->E;
     99    Px=part->Px;
     100    Py=part->Py;
     101    Pz=part->Pz;
     102    Eta=part->Eta;
     103    Phi=part->Phi;
     104    PT=part->PT;
     105    _initialised=false;
    92106}
    93107
  • trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h

    r268 r270  
    4242#pragma link C++ class TRootSelectorInfo;
    4343#pragma link C++ class TRootGenParticle;
     44#pragma link C++ class GenParticle;
    4445#pragma link C++ class TRootElectron;
    4546#pragma link C++ class TRootMuon;
  • trunk/interface/SmearUtil.h

    r264 r270  
    244244
    245245//************* Returns an array of the quarks sitting within the tracker acceptance ***************
    246 int Charge(const int pid);
     246int ChargeVal(const int pid);
    247247
    248248#endif
  • trunk/src/BFieldProp.cc

    r264 r270  
    118118void TrackPropagation::Propagation(const TRootGenParticle *Part,TLorentzVector &momentum) {
    119119
    120   q  = Charge(Part->PID);
     120  q  = ChargeVal(Part->PID);
    121121  if(q==0) return;
    122122
     
    324324  if (!DET->FLAG_bfield ) return;
    325325
    326   q  = Charge(Part->PID);
     326  q  = ChargeVal(Part->PID);
    327327  if(q==0) return;
    328328  if(R_max ==0) { cout << "ERROR: magnetic field has no lateral extention\n"; return;}
  • trunk/src/HEPEVTConverter.cc

    r264 r270  
    176176
    177177  ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN");
    178   ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", TRootGenParticle::Class());
     178  ExRootTreeBranch *branchGen = treeWriter->NewBranch("Particle", GenParticle::Class());
    179179 
    180180  ifstream infile(inputFileList.c_str());
     
    211211      Float_t signEta;
    212212     
    213       TRootGenParticle *element;
     213      GenParticle *element;
    214214     
    215215      // Loop over all events
     
    222222          for(particle = 0; particle < event.Nhep; ++particle)
    223223            {
    224               element = (TRootGenParticle*) branchGen->NewEntry();
     224              element = (GenParticle*) branchGen->NewEntry();
    225225             
    226226              element->PID = event.Idhep[particle];     
  • trunk/src/STDHEPConverter.cc

    r264 r270  
    5858void STDHEPConverter::AnalyseParticles(ExRootTreeBranch *branch)
    5959{
    60   TRootGenParticle *element;
     60  GenParticle *element;
    6161
    6262  Double_t signPz;
     
    6666  for(number = 0; number < myhepevt.nhep; ++number)
    6767  {
    68     element = static_cast<TRootGenParticle*>(branch->NewEntry());
     68    element = static_cast<GenParticle*>(branch->NewEntry());
    6969
    7070    element->PID = myhepevt.idhep[number];
     
    116116  ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class());
    117117  // generated particles from HEPEVT
    118   ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootGenParticle::Class());
     118  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", GenParticle::Class());
    119119 
    120120  // Open a stream connected to an event file:
  • trunk/src/SmearUtil.cc

    r264 r270  
    11051105}
    11061106
    1107 int Charge(const int pid)
     1107int ChargeVal(const int pid)
    11081108{
    11091109  int charge;
Note: See TracChangeset for help on using the changeset viewer.