Fork me on GitHub

Changeset 350 in svn


Ignore:
Timestamp:
May 6, 2009, 8:57:21 PM (16 years ago)
Author:
severine ovyn
Message:

first test HepMC

Location:
trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r344 r350  
    4646#include "HEPEVTConverter.h"
    4747#include "LHEFConverter.h"
     48#include "HepMCConverter.h"
    4849#include "STDHEPConverter.h"
    4950#include "LHCOConverter.h"
     
    273274      converter = new HEPEVTConverter(inputFileList,outputfilename);//case ntpl file in input list
    274275    }
    275   else if(line.length() == 1+line.find_last_of(".hepmc")) 
    276     {
    277       cout <<"**                   hepmc file format detected                    **"<<endl;
    278       cout <<"**               Delphes can not yet used this format              **"<<endl;
    279         return -1;
     276  else if(line.length() == 1+line.find_last_of(".hepmc"))
     277    {
     278      cout <<"**                HepMC ASCII file format detected                 **"<<endl;
     279      cout <<"**                  This can take several minutes                  **"<< endl;
     280      converter = new HepMCConverter(inputFileList,outputfilename);
    280281    }
    281282  else {
     
    332333  vector<int> NTrackJet;
    333334
    334   TSimpleArray<GenParticle> NFCentralQ;
     335  TSimpleArray<TRootC::GenParticle> NFCentralQ;
    335336 
    336337  D_CaloList list_of_calorimeters;
     
    392393      // 2.1a Loop over all particles in event, to fill the towers
    393394      itGen.Reset();
    394       GenParticle *particleG;
    395       while( (particleG = (GenParticle*) itGen.Next()) )
     395      TRootC::GenParticle *particleG;
     396      while( (particleG = (TRootC::GenParticle*) itGen.Next()) )
    396397        {
    397398          TRootGenParticle *particle = new TRootGenParticle(particleG);
  • trunk/Examples/src/Analysis_Ex.cc

    r270 r350  
    145145      //*****************************************************
    146146      TIter itGen((TCollection*)GEN);
    147       GenParticle *gen;
     147      TRootC::GenParticle *gen;
    148148      itGen.Reset();
    149       while( (gen = (GenParticle*) itGen.Next()) )
     149      while( (gen = (TRootC::GenParticle*) itGen.Next()) )
    150150        {
    151151          PID      = gen->PID;      // particle HEP ID number
  • trunk/Makefile

    r335 r350  
    1616SrcSuf = cc
    1717
    18 CXXFLAGS += $(ROOTCFLAGS) -DDROP_CGAL -I. -Iinterface -IUtilities/mcfio -IUtilities/stdhep -IUtilities/Hector/include -IUtilities/CDFCones/interface -IExamples -IUtilities/FROG/Includes/FROG -IUtilities/ExRootAnalysis/interface -IUtilities/Fastjet/include/fastjet -IUtilities/Fastjet/plugins/CDFCones -IUtilities/Fastjet/plugins/CDFCones/interface -IUtilities/Fastjet/plugins/SISCone -IUtilities/CLHEP/Units
     18CXXFLAGS += $(ROOTCFLAGS) -DDROP_CGAL -I. -Iinterface -IUtilities/mcfio -IUtilities/stdhep -IUtilities/Hector/include -IUtilities/CDFCones/interface -IExamples -IUtilities/FROG/Includes/FROG -IUtilities/ExRootAnalysis/interface -IUtilities/Fastjet/include/fastjet -IUtilities/Fastjet/plugins/CDFCones -IUtilities/Fastjet/plugins/CDFCones/interface -IUtilities/Fastjet/plugins/SISCone -IUtilities/CLHEP/Units -IUtilities/HepMC/interface
    1919# -pg -g
    2020LIBS = $(ROOTLIBS) -lEG $(SYSLIBS)
     
    121121tmp/src/LHEFConverter.$(ObjSuf): \
    122122        src/LHEFConverter.$(SrcSuf)
     123tmp/src/HepMCConverter.$(ObjSuf): \
     124        src/HepMCConverter.$(SrcSuf)
    123125tmp/src/FrogUtil.$(ObjSuf): \
    124126        src/FrogUtil.$(SrcSuf)
     
    129131tmp/src/D_Constants.$(ObjSuf): \
    130132        src/D_Constants.$(SrcSuf)
     133tmp/src/HEPMCConverter.$(ObjSuf): \
     134        src/HEPMCConverter.$(SrcSuf)
    131135tmp/src/TreeClasses.$(ObjSuf): \
    132136        src/TreeClasses.$(SrcSuf)
     
    304308        Examples/src/Analysis_Ex.$(SrcSuf) \
    305309        Examples/interface/Analysis_Ex.h
     310tmp/Utilities/HepMC/src/SearchVector.$(ObjSuf): \
     311        Utilities/HepMC/src/SearchVector.$(SrcSuf)
     312tmp/Utilities/HepMC/src/Units.$(ObjSuf): \
     313        Utilities/HepMC/src/Units.$(SrcSuf)
     314tmp/Utilities/HepMC/src/Polarization.$(ObjSuf): \
     315        Utilities/HepMC/src/Polarization.$(SrcSuf)
     316tmp/Utilities/HepMC/src/ParticleData.$(ObjSuf): \
     317        Utilities/HepMC/src/ParticleData.$(SrcSuf)
     318tmp/Utilities/HepMC/src/IO_PDG_ParticleDataTable.$(ObjSuf): \
     319        Utilities/HepMC/src/IO_PDG_ParticleDataTable.$(SrcSuf)
     320tmp/Utilities/HepMC/src/Flow.$(ObjSuf): \
     321        Utilities/HepMC/src/Flow.$(SrcSuf)
     322tmp/Utilities/HepMC/src/GenEvent.$(ObjSuf): \
     323        Utilities/HepMC/src/GenEvent.$(SrcSuf)
     324tmp/Utilities/HepMC/src/IO_Ascii.$(ObjSuf): \
     325        Utilities/HepMC/src/IO_Ascii.$(SrcSuf)
     326tmp/Utilities/HepMC/src/GenParticle.$(ObjSuf): \
     327        Utilities/HepMC/src/GenParticle.$(SrcSuf)
     328tmp/Utilities/HepMC/src/IO_GenEvent.$(ObjSuf): \
     329        Utilities/HepMC/src/IO_GenEvent.$(SrcSuf)
     330tmp/Utilities/HepMC/src/GenVertex.$(ObjSuf): \
     331        Utilities/HepMC/src/GenVertex.$(SrcSuf)
     332tmp/Utilities/HepMC/src/CompareGenEvent.$(ObjSuf): \
     333        Utilities/HepMC/src/CompareGenEvent.$(SrcSuf)
     334tmp/Utilities/HepMC/src/IO_AsciiParticles.$(ObjSuf): \
     335        Utilities/HepMC/src/IO_AsciiParticles.$(SrcSuf)
     336tmp/Utilities/HepMC/src/CommonIO.$(ObjSuf): \
     337        Utilities/HepMC/src/CommonIO.$(SrcSuf)
    306338SOURCE_OBJ =  \
    307339        tmp/src/JetsUtil.$(ObjSuf) \
     
    312344        tmp/src/VeryForward.$(ObjSuf) \
    313345        tmp/src/LHEFConverter.$(ObjSuf) \
     346        tmp/src/HepMCConverter.$(ObjSuf) \
    314347        tmp/src/FrogUtil.$(ObjSuf) \
    315348        tmp/src/STDHEPConverter.$(ObjSuf) \
    316349        tmp/src/HEPEVTConverter.$(ObjSuf) \
    317350        tmp/src/D_Constants.$(ObjSuf) \
     351        tmp/src/HEPMCConverter.$(ObjSuf) \
    318352        tmp/src/TreeClasses.$(ObjSuf) \
    319353        tmp/src/LHCOConverter.$(ObjSuf) \
     
    400434        tmp/Utilities/Fastjet/plugins/SISCone/src/momentum.$(ObjSuf) \
    401435        tmp/Utilities/Fastjet/plugins/SISCone/src/quadtree.$(ObjSuf) \
    402         tmp/Examples/src/Analysis_Ex.$(ObjSuf)
     436        tmp/Examples/src/Analysis_Ex.$(ObjSuf) \
     437        tmp/Utilities/HepMC/src/SearchVector.$(ObjSuf) \
     438        tmp/Utilities/HepMC/src/Units.$(ObjSuf) \
     439        tmp/Utilities/HepMC/src/Polarization.$(ObjSuf) \
     440        tmp/Utilities/HepMC/src/ParticleData.$(ObjSuf) \
     441        tmp/Utilities/HepMC/src/IO_PDG_ParticleDataTable.$(ObjSuf) \
     442        tmp/Utilities/HepMC/src/Flow.$(ObjSuf) \
     443        tmp/Utilities/HepMC/src/GenEvent.$(ObjSuf) \
     444        tmp/Utilities/HepMC/src/IO_Ascii.$(ObjSuf) \
     445        tmp/Utilities/HepMC/src/GenParticle.$(ObjSuf) \
     446        tmp/Utilities/HepMC/src/IO_GenEvent.$(ObjSuf) \
     447        tmp/Utilities/HepMC/src/GenVertex.$(ObjSuf) \
     448        tmp/Utilities/HepMC/src/CompareGenEvent.$(ObjSuf) \
     449        tmp/Utilities/HepMC/src/IO_AsciiParticles.$(ObjSuf) \
     450        tmp/Utilities/HepMC/src/CommonIO.$(ObjSuf)
    403451
    404452tmp/Utilities/mcfio/mcfio_UserDictionary.$(ObjSuf): \
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r323 r350  
    177177//--------------------------------------------------------------------------
    178178class TRootGenParticle;
     179
     180namespace TRootC {
    179181class GenParticle: public TRootParticle {
    180182
     
    202204  ClassDef(GenParticle, 1)
    203205};
     206}
    204207
    205208//---------------------------------------------------------------------------
     
    210213  TRootGenParticle() {_initialised=false;}
    211214  TRootGenParticle(const int pid): PID(pid) {_initialised=false;}
    212   TRootGenParticle(GenParticle* part);
     215  TRootGenParticle(TRootC::GenParticle* part);
    213216
    214217  int PID; // particle HEP ID number [RawHepEventParticle::pid()]
  • trunk/genMakefile.tcl

    r296 r350  
    217217SrcSuf = cc
    218218
    219 CXXFLAGS += $(ROOTCFLAGS) -DDROP_CGAL -I. -Iinterface -IUtilities/mcfio -IUtilities/stdhep -IUtilities/Hector/include -IUtilities/CDFCones/interface -IExamples -IUtilities/FROG/Includes/FROG -IUtilities/ExRootAnalysis/interface -IUtilities/Fastjet/include/fastjet -IUtilities/Fastjet/plugins/CDFCones -IUtilities/Fastjet/plugins/CDFCones/interface -IUtilities/Fastjet/plugins/SISCone -IUtilities/CLHEP/Units
     219CXXFLAGS += $(ROOTCFLAGS) -DDROP_CGAL -I. -Iinterface -IUtilities/mcfio -IUtilities/stdhep -IUtilities/Hector/include -IUtilities/CDFCones/interface -IExamples -IUtilities/FROG/Includes/FROG -IUtilities/ExRootAnalysis/interface -IUtilities/Fastjet/include/fastjet -IUtilities/Fastjet/plugins/CDFCones -IUtilities/Fastjet/plugins/CDFCones/interface -IUtilities/Fastjet/plugins/SISCone -IUtilities/CLHEP/Units -IUtilities/HepMC/interface
    220220# -pg -g
    221221LIBS = $(ROOTLIBS) -lEG $(SYSLIBS)
     
    239239dictDeps {DICT} {Utilities/ExRootAnalysis/src/*LinkDef.h} {src/*LinkDef.h} {Examples/src/*LinkDef.h}
    240240
    241 sourceDeps {SOURCE} {src/*.cc} {Utilities/ExRootAnalysis/src/*.cc} {Utilities/Hector/src/*.cc} {Utilities/CDFCones/src/*cc} {Utilities/Fastjet/src/*.cc} {Utilities/Fastjet/plugins/CDFCones/*.cc} {Utilities/Fastjet/plugins/CDFCones/src/*.cc} {Utilities/Fastjet/plugins/SISCone/*.cc} {Utilities/Fastjet/plugins/SISCone/src/*.cc} {Examples/src/*.cc}
     241sourceDeps {SOURCE} {src/*.cc} {Utilities/ExRootAnalysis/src/*.cc} {Utilities/Hector/src/*.cc} {Utilities/CDFCones/src/*cc} {Utilities/Fastjet/src/*.cc} {Utilities/Fastjet/plugins/CDFCones/*.cc} {Utilities/Fastjet/plugins/CDFCones/src/*.cc} {Utilities/Fastjet/plugins/SISCone/*.cc} {Utilities/Fastjet/plugins/SISCone/src/*.cc} {Examples/src/*.cc} {Utilities/HepMC/src/*.cc}
    242242
    243243stdhepDeps
  • trunk/interface/JetsUtil.h

    r319 r350  
    8383  vector<fastjet::PseudoJet> RunJetsResol(const vector<fastjet::PseudoJet>&  input_particles);
    8484 
    85   void RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<GenParticle> & NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM);
     85  void RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle> & NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM);
    8686 
    8787  void RunTauJets(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchTauJet,const vector<fastjet::PseudoJet> & sorted_jets,const vector<PhysicsTower> & towers, const vector<TRootTracks> & TrackCentral, const vector<int> &NTrackJet, const vector<float> &EHADEEM);
  • trunk/interface/SmearUtil.h

    r332 r350  
    227227
    228228  /// b-jets
    229   int Bjets(const TSimpleArray<GenParticle> &subarray, const float& eta, const float& phi);
     229  int Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi);
    230230 
    231231  /// b-tag efficiency and misidentification
    232   bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<GenParticle> &subarray);
     232  bool Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootC::GenParticle> &subarray);
    233233
    234234  /// Lepton isolation based on tracking
  • trunk/src/HEPEVTConverter.cc

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

    r347 r350  
    5555  ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN");
    5656  ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class());
    57   ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", GenParticle::Class());
     57  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootC::GenParticle::Class());
    5858 
    5959  // Open the datafile list
  • trunk/src/JetsUtil.cc

    r315 r350  
    190190
    191191
    192 void JetsUtil::RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<GenParticle>& NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM)
     192void JetsUtil::RunJetBtagging(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchJet,const vector<fastjet::PseudoJet> & sorted_jets,const TSimpleArray<TRootC::GenParticle>& NFCentralQ, const vector<int> &NTrackJet, const vector<float> &EHADEEM)
    193193{
    194194  TRootJet *elementJet;
  • trunk/src/STDHEPConverter.cc

    r295 r350  
    6262  else Nmax = myhepevt.nhep;
    6363
    64   GenParticle *element;
     64  TRootC::GenParticle *element;
    6565
    6666  Double_t signPz;
     
    7070  for(number = 0; number < Nmax; ++number)
    7171  {
    72     element = static_cast<GenParticle*>(branch->NewEntry());
     72    element = static_cast<TRootC::GenParticle*>(branch->NewEntry());
    7373
    7474    element->PID = myhepevt.idhep[number];
     
    119119  ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class());
    120120  // generated particles from HEPEVT
    121   ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", GenParticle::Class());
     121  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootC::GenParticle::Class());
    122122 
    123123  // Open a stream connected to an event file:
  • trunk/src/SmearUtil.cc

    r333 r350  
    10641064//used by Btaggedjet
    10651065///// Attention : bug removed => CONERADIUS/2 -> CONERADIUS !!
    1066 int RESOLution::Bjets(const TSimpleArray<GenParticle> &subarray, const float& eta, const float& phi) {
     1066int RESOLution::Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi) {
    10671067  float emax=0;
    10681068  int Ppid=0;
     
    10811081
    10821082//******************** Simulates the b-tagging efficiency for real bjet, or the misendentification for other jets****************
    1083 bool RESOLution::Btaggedjet(const TLorentzVector &JET, const TSimpleArray<GenParticle> &subarray) {
     1083bool RESOLution::Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootC::GenParticle> &subarray) {
    10841084  if(      rand()%100 < (BTAG_b+1)    && Bjets(subarray,JET.Eta(),JET.Phi())==pB ) return true; // b-tag of b-jets is 40%
    10851085  else if( rand()%100 < (BTAG_mistag_c+1) && Bjets(subarray,JET.Eta(),JET.Phi())==pC ) return true; // b-tag of c-jets is 10%
Note: See TracChangeset for help on using the changeset viewer.