Fork me on GitHub

Changeset 450 in svn


Ignore:
Timestamp:
Jul 3, 2009, 6:14:36 PM (15 years ago)
Author:
Xavier Rouby
Message:

lhe bug (empty Analysis tree) solved

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r443 r450  
     1
     2* Changes relative to V.1.7b
     3   - LHE files where not processed correctly (empty Analysis/Trigger trees). Now LHEFParticle derives from TRootC::GenParticle as it should.
    14
    25 /-----------------------------------------\
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r408 r450  
    7373//---------------------------------------------------------------------------
    7474
     75//---------------------------------------------------------------------------
     76/*
    7577class TRootLHEFParticle: public TSortableObject
    7678{
     
    100102                     // (c*tau, distance from production to decay in mm)
    101103                     // | hepup.VTIMUP[number]
    102                      
     104
    103105  double Spin; // cosine of the angle between the particle spin vector
    104106                 // and the decaying particle 3-momentum,
     
    110112
    111113};
    112 
     114*/
    113115//---------------------------------------------------------------------------
    114116
     
    526528
    527529
     530
     531
     532class TRootLHEFParticle: public TRootC::GenParticle
     533{
     534public:
     535  TRootLHEFParticle() {};
     536  int ColorLine1; // index for the particle color-line | hepup.ICOLUP[number][0]
     537  int ColorLine2; // index for the particle anti-color-line | hepup.ICOLUP[number][1]
     538
     539  double Rapidity; // particle rapidity
     540  double LifeTime; // particle invariant lifetime
     541                     // (c*tau, distance from production to decay in mm)
     542                     // | hepup.VTIMUP[number]
     543
     544  double Spin; // cosine of the angle between the particle spin vector
     545                 // and the decaying particle 3-momentum,
     546                 // specified in the lab frame. | hepup.SPINUP[number]
     547
     548  static TCompare *fgCompare; //!
     549  const TCompare *GetCompare() const { return fgCompare; }
     550  ClassDef(TRootLHEFParticle, 2)
     551
     552};
     553
    528554#endif // BLOCKCLASSES_H
    529555
  • trunk/interface/LHEFConverter.h

    r443 r450  
    5757  void AnalyseEvent(LHEF::Reader *reader, ExRootTreeBranch *branch, const Long64_t eventNumber);
    5858  void AnalyseParticles(LHEF::Reader *reader, ExRootTreeBranch *branch);
     59  //void AnalyseLHEFParticles(LHEF::Reader *reader, ExRootTreeBranch *branch);
    5960
    6061};
  • trunk/src/LHEFConverter.cc

    r443 r450  
    8080    element->PID = hepeup.IDUP[particle];
    8181    element->Status = hepeup.ISTUP[particle];
    82     element->Mother1 = hepeup.MOTHUP[particle].first;
    83     element->Mother2 = hepeup.MOTHUP[particle].second;
     82    element->M1 = hepeup.MOTHUP[particle].first;
     83    element->M2 = hepeup.MOTHUP[particle].second;
     84    element->D1 = 0;
     85    element->D2 = 0;
    8486    element->ColorLine1 = hepeup.ICOLUP[particle].first;
    8587    element->ColorLine2 = hepeup.ICOLUP[particle].second;
     
    107109}
    108110
     111
     112//---------------------------------------------------------------------------
     113/*
     114void LHEFConverter::AnalyseParticles(LHEF::Reader *reader, ExRootTreeBranch *branch)
     115{
     116  const LHEF::HEPEUP &hepeup = reader->hepeup;
     117  Double_t signPz;
     118  TLorentzVector momentum;
     119  TRootC::GenParticle *element;
     120
     121  for(Int_t particle = 0; particle < hepeup.NUP; ++particle)
     122  {
     123    element = (TRootC::GenParticle*) branch->NewEntry();
     124
     125    element->PID = hepeup.IDUP[particle];
     126    element->Status = hepeup.ISTUP[particle];
     127    element->M1 = hepeup.MOTHUP[particle].first;
     128    element->M2 = hepeup.MOTHUP[particle].second;
     129    //element->ColorLine1 = hepeup.ICOLUP[particle].first;
     130    //element->ColorLine2 = hepeup.ICOLUP[particle].second;
     131    element->D1 = 0;
     132    element->D2 = 0;
     133
     134    PdgParticle pdg_part = pdg_table[element->PID];
     135    element->Charge = pdg_part.charge();
     136    element->M = pdg_part.mass();
     137    //element->Charge = ChargeVal(element->PID);
     138    //element->M = hepeup.PUP[particle][4];
     139
     140    element->E = hepeup.PUP[particle][3];
     141    element->Px = hepeup.PUP[particle][0];
     142    element->Py = hepeup.PUP[particle][1];
     143    element->Pz = hepeup.PUP[particle][2];
     144
     145    momentum.SetPxPyPzE(element->Px, element->Py, element->Pz, element->E);
     146    element->PT = momentum.Perp();
     147    signPz = (element->Pz >= 0.0) ? 1.0 : -1.0;
     148    //element->Eta = element->PT == 0.0 ? signPz*999.9 : momentum.Eta(); to avoid a warning from ROOT, replace the "==0" by "< 1e-6"
     149    element->Eta = element->PT < 1E-6 ? signPz*999.9 : momentum.Eta();
     150    element->Phi = momentum.Phi();
     151//    element->Rapidity = element->PT < 1E-6 ? signPz*999.9 : momentum.Rapidity();
     152//    element->LifeTime = hepeup.VTIMUP[particle];
     153//    element->Spin = hepeup.SPINUP[particle];
     154  }
     155}
     156*/
     157
    109158LHEFConverter::~LHEFConverter()
    110159{
     
    112161
    113162//------------------------------------------------------------------------------
    114 LHEFConverter::LHEFConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) :
    115  DataConverter(pdg,Nevents) {
     163LHEFConverter::LHEFConverter(const string& inputFileList, const string& outputFileName, const PdgTable& pdg, const int& Nevents) : DataConverter(pdg,Nevents) {
    116164
    117165  ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN");
     
    122170  // generated partons from LHEF
    123171  ExRootTreeBranch *branchParticle = treeWriter->NewBranch("Particle", TRootLHEFParticle::Class());
     172  //ExRootTreeBranch *branchParticle = treeWriter->NewBranch("Particle", TRootC::GenParticle::Class());
    124173 
    125174  // Open a stream connected to an event file:
     
    167216  }
    168217  treeWriter->Write();
    169  
    170  
    171218  delete treeWriter;
    172219  //delete inputReader;
Note: See TracChangeset for help on using the changeset viewer.