Fork me on GitHub

Changeset 28027d5 in git for classes


Ignore:
Timestamp:
Jun 26, 2015, 3:13:55 PM (9 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
f3c4047
Parents:
f53a4d2 (diff), fe0273c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge pull request #15 from delphes/mergeCMS

merge with the CMS code

Location:
classes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • classes/ClassesLinkDef.h

    rf53a4d2 r28027d5  
    4646#pragma link C++ class LHCOEvent+;
    4747#pragma link C++ class LHEFEvent+;
     48#pragma link C++ class LHEFWeight+;
    4849#pragma link C++ class HepMCEvent+;
    4950#pragma link C++ class GenParticle+;
  • classes/DelphesClasses.cc

    rf53a4d2 r28027d5  
    120120  PID(0), Status(0), M1(-1), M2(-1), D1(-1), D2(-1),
    121121  Charge(0), Mass(0.0),
    122   IsPU(0), IsConstituent(0),
    123   BTag(0), TauTag(0), Eem(0.0), Ehad(0.0),
     122  IsPU(0), IsRecoPU(0), IsConstituent(0),
     123  Flavor(0), FlavorAlgo(0), FlavorPhys(0),
     124  BTag(0), BTagAlgo(0), BTagPhys(0),
     125  TauTag(0), Eem(0.0), Ehad(0.0),
    124126  DeltaEta(0.0), DeltaPhi(0.0),
    125127  Momentum(0.0, 0.0, 0.0, 0.0),
     
    129131  NCharged(0),
    130132  NNeutrals(0),
     133  NSubJetsTrimmed(0),
     134  NSubJetsPruned(0),
     135  NSubJetsSoftDropped(0),
    131136  Beta(0),
    132137  BetaStar(0),
    133138  MeanSqDeltaR(0),
    134139  PTD(0),
     140  Ntimes(-1),
     141  IsolationVar(-999),
     142  IsolationVarRhoCorr(-999),
     143  SumPtCharged(-999),
     144  SumPtNeutral(-999),
     145  SumPtChargedPU(-999),
     146  SumPt(-999),
    135147  fFactory(0),
    136148  fArray(0)
    137149{
     150  int i;
    138151  Edges[0] = 0.0;
    139152  Edges[1] = 0.0;
     
    150163  Tau[3] = 0.0;
    151164  Tau[4] = 0.0;
     165  for(i = 0; i < 5; ++i)
     166  {
     167    TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     168    PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     169    SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     170  }
    152171}
    153172
     
    224243  object.IsPU = IsPU;
    225244  object.IsConstituent = IsConstituent;
     245  object.Flavor = Flavor;
     246  object.FlavorAlgo = FlavorAlgo;
     247  object.FlavorPhys = FlavorPhys;
    226248  object.BTag = BTag;
     249  object.BTagAlgo = BTagAlgo;
     250  object.BTagPhys = BTagPhys;
    227251  object.TauTag = TauTag;
    228252  object.Eem = Eem;
     
    249273  object.MeanSqDeltaR = MeanSqDeltaR;
    250274  object.PTD = PTD;
     275  object.Ntimes = Ntimes;
     276  object.IsolationVar = IsolationVar;
     277  object.IsolationVarRhoCorr = IsolationVarRhoCorr;
     278  object.SumPtCharged = SumPtCharged;
     279  object.SumPtNeutral = SumPtNeutral;
     280  object.SumPtChargedPU = SumPtChargedPU;
     281  object.SumPt = SumPt;
     282
    251283  object.FracPt[0] = FracPt[0];
    252284  object.FracPt[1] = FracPt[1];
     
    259291  object.Tau[3] = Tau[3];
    260292  object.Tau[4] = Tau[4];
     293 
     294  object.TrimmedP4[0] = TrimmedP4[0];
     295  object.TrimmedP4[1] = TrimmedP4[1];
     296  object.TrimmedP4[2] = TrimmedP4[2];
     297  object.TrimmedP4[3] = TrimmedP4[3];
     298  object.TrimmedP4[4] = TrimmedP4[4];
     299  object.PrunedP4[0] = PrunedP4[0];
     300  object.PrunedP4[1] = PrunedP4[1];
     301  object.PrunedP4[2] = PrunedP4[2];
     302  object.PrunedP4[3] = PrunedP4[3];
     303  object.PrunedP4[4] = PrunedP4[4];
     304  object.SoftDroppedP4[0] = SoftDroppedP4[0];
     305  object.SoftDroppedP4[1] = SoftDroppedP4[1];
     306  object.SoftDroppedP4[2] = SoftDroppedP4[2];
     307  object.SoftDroppedP4[3] = SoftDroppedP4[3];
     308  object.SoftDroppedP4[4] = SoftDroppedP4[4];
     309
     310  object.NSubJetsTrimmed = NSubJetsTrimmed;
     311  object.NSubJetsPruned = NSubJetsPruned;
     312  object.NSubJetsSoftDropped = NSubJetsSoftDropped;
    261313
    262314  object.fFactory = fFactory;
    263315  object.fArray = 0;
     316
     317  // Copy cluster timing info
     318  copy(Ecal_E_t.begin(),Ecal_E_t.end(),back_inserter(object.Ecal_E_t));
    264319
    265320  if(fArray && fArray->GetEntriesFast() > 0)
     
    278333void Candidate::Clear(Option_t* option)
    279334{
     335  int i;
    280336  SetUniqueID(0);
    281337  ResetBit(kIsReferenced);
     
    287343  IsPU = 0;
    288344  IsConstituent = 0;
     345  Flavor = 0;
     346  FlavorAlgo = 0;
     347  FlavorPhys = 0;
    289348  BTag = 0;
     349  BTagAlgo = 0;
     350  BTagPhys = 0;
    290351  TauTag = 0;
    291352  Eem = 0.0;
     
    311372  MeanSqDeltaR = 0.0;
    312373  PTD = 0.0;
     374 
     375  Ntimes = 0;
     376  Ecal_E_t.clear();
     377 
     378  IsolationVar = -999;
     379  IsolationVarRhoCorr = -999;
     380  SumPtCharged = -999;
     381  SumPtNeutral = -999;
     382  SumPtChargedPU = -999;
     383  SumPt = -999;
     384 
    313385  FracPt[0] = 0.0;
    314386  FracPt[1] = 0.0;
     
    321393  Tau[3] = 0.0;
    322394  Tau[4] = 0.0;
    323 
     395 
     396  for(i = 0; i < 5; ++i)
     397  {
     398    TrimmedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     399    PrunedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     400    SoftDroppedP4[i].SetXYZT(0.0, 0.0, 0.0, 0.0);
     401  }
     402
     403  NSubJetsTrimmed = 0;
     404  NSubJetsPruned = 0;
     405  NSubJetsSoftDropped = 0;
     406 
    324407  fArray = 0;
    325408}
  • classes/DelphesClasses.h

    rf53a4d2 r28027d5  
    8484//---------------------------------------------------------------------------
    8585
     86class LHEFWeight: public TObject
     87{
     88public:
     89  Int_t ID; // weight ID
     90  Float_t Weight; // weight value
     91
     92  ClassDef(LHEFWeight, 1)
     93};
     94
     95//---------------------------------------------------------------------------
     96
    8697class HepMCEvent: public Event
    8798{
     
    231242  TRefArray Particles; // references to generated particles
    232243
     244  // Isolation variables
     245
     246  Float_t IsolationVar;
     247  Float_t IsolationVarRhoCorr;
     248  Float_t SumPtCharged;
     249  Float_t SumPtNeutral;
     250  Float_t SumPtChargedPU;
     251  Float_t SumPt;
     252
    233253  static CompBase *fgCompare; //!
    234254  const CompBase *GetCompare() const { return fgCompare; }
     
    257277  TRef Particle; // reference to generated particle
    258278
     279  // Isolation variables
     280
     281  Float_t IsolationVar;
     282  Float_t IsolationVarRhoCorr;
     283  Float_t SumPtCharged;
     284  Float_t SumPtNeutral;
     285  Float_t SumPtChargedPU;
     286  Float_t SumPt;
     287
    259288  static CompBase *fgCompare; //!
    260289  const CompBase *GetCompare() const { return fgCompare; }
     
    281310  TRef Particle; // reference to generated particle
    282311
     312   // Isolation variables
     313
     314  Float_t IsolationVar;
     315  Float_t IsolationVarRhoCorr;
     316  Float_t SumPtCharged;
     317  Float_t SumPtNeutral;
     318  Float_t SumPtChargedPU;
     319  Float_t SumPt;
     320
    283321  static CompBase *fgCompare; //!
    284322  const CompBase *GetCompare() const { return fgCompare; }
     
    306344  Float_t DeltaPhi;  // jet radius in azimuthal angle
    307345
     346  UInt_t Flavor;
     347  UInt_t FlavorAlgo;
     348  UInt_t FlavorPhys;
     349
    308350  UInt_t BTag; // 0 or 1 for a jet that has been tagged as containing a heavy quark
     351  UInt_t BTagAlgo;
     352  UInt_t BTagPhys;
     353
    309354  UInt_t TauTag; // 0 or 1 for a jet that has been tagged as a tau
    310355
     
    313358  Float_t EhadOverEem; // ratio of the hadronic versus electromagnetic energy deposited in the calorimeter
    314359
    315   Int_t    NCharged; // number of charged constituents
    316   Int_t    NNeutrals; // number of neutral constituents
    317   Float_t  Beta; // (sum pt of charged pile-up constituents)/(sum pt of charged constituents)
    318   Float_t  BetaStar; // (sum pt of charged constituents coming from hard interaction)/(sum pt of charged constituents)
    319   Float_t  MeanSqDeltaR; // average distance (squared) between constituent and jet weighted by pt (squared) of constituent
    320   Float_t  PTD; // average pt between constituent and jet weighted by pt of constituent
    321   Float_t  FracPt[5]; // (sum pt of constituents within a ring 0.1*i < DeltaR < 0.1*(i+1))/(sum pt of constituents)
    322 
    323   Float_t Tau1; // 1-subjettiness
    324   Float_t Tau2; // 2-subjettiness
    325   Float_t Tau3; // 3-subjettiness
    326   Float_t Tau4; // 4-subjettiness
    327   Float_t Tau5; // 5-subjettiness
     360  Int_t NCharged; // number of charged constituents
     361  Int_t NNeutrals; // number of neutral constituents
     362  Float_t Beta; // (sum pt of charged pile-up constituents)/(sum pt of charged constituents)
     363  Float_t BetaStar; // (sum pt of charged constituents coming from hard interaction)/(sum pt of charged constituents)
     364  Float_t MeanSqDeltaR; // average distance (squared) between constituent and jet weighted by pt (squared) of constituent
     365  Float_t PTD; // average pt between constituent and jet weighted by pt of constituent
     366  Float_t FracPt[5]; // (sum pt of constituents within a ring 0.1*i < DeltaR < 0.1*(i+1))/(sum pt of constituents)
     367
     368  Float_t Tau[5]; // N-subjettiness
     369
     370  TLorentzVector TrimmedP4[5]; // first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
     371  TLorentzVector PrunedP4[5]; // first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     372  TLorentzVector SoftDroppedP4[5]; // first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     373
     374  Int_t NSubJetsTrimmed; // number of subjets trimmed
     375  Int_t NSubJetsPruned; // number of subjets pruned
     376  Int_t NSubJetsSoftDropped; // number of subjets soft-dropped
    328377
    329378  TRefArray Constituents; // references to constituents
     
    334383
    335384  TLorentzVector P4() const;
    336 
    337   ClassDef(Jet, 2)
     385  TLorentzVector Area;
     386
     387  ClassDef(Jet, 3)
    338388};
    339389
     
    392442  Float_t E; // calorimeter tower energy
    393443
    394   Float_t T; //particle arrival time of flight
     444  Float_t T; // ecal deposit time, averaged by sqrt(EM energy) over all particles, not smeared
     445  Int_t   Ntimes; // number of hits contributing to time measurement
    395446
    396447  Float_t Eem; // calorimeter tower electromagnetic energy
     
    452503
    453504  Int_t IsPU;
     505  Int_t IsRecoPU;
     506
    454507  Int_t IsConstituent;
    455508
     509  UInt_t Flavor;
     510  UInt_t FlavorAlgo;
     511  UInt_t FlavorPhys;
     512
    456513  UInt_t BTag;
     514  UInt_t BTagAlgo;
     515  UInt_t BTagPhys;
     516
    457517  UInt_t TauTag;
    458518
     
    482542  Float_t  FracPt[5];
    483543
     544  //Timing information
     545
     546  Int_t    Ntimes;
     547  std::vector<std::pair<Float_t,Float_t> > Ecal_E_t;
     548
     549  // Isolation variables
     550
     551  Float_t IsolationVar;
     552  Float_t IsolationVarRhoCorr;
     553  Float_t SumPtCharged;
     554  Float_t SumPtNeutral;
     555  Float_t SumPtChargedPU;
     556  Float_t SumPt;
     557
    484558  // N-subjettiness variables
    485559
    486560  Float_t Tau[5];
     561
     562  // Other Substructure variables
     563
     564  TLorentzVector TrimmedP4[5]; // first entry (i = 0) is the total Trimmed Jet 4-momenta and from i = 1 to 4 are the trimmed subjets 4-momenta
     565  TLorentzVector PrunedP4[5]; // first entry (i = 0) is the total Pruned Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     566  TLorentzVector SoftDroppedP4[5]; // first entry (i = 0) is the total SoftDropped Jet 4-momenta and from i = 1 to 4 are the pruned subjets 4-momenta
     567
     568  Int_t NSubJetsTrimmed; // number of subjets trimmed
     569  Int_t NSubJetsPruned; // number of subjets pruned
     570  Int_t NSubJetsSoftDropped; // number of subjets soft-dropped
     571
    487572
    488573  static CompBase *fgCompare; //!
     
    504589  void SetFactory(DelphesFactory *factory) { fFactory = factory; }
    505590
    506   ClassDef(Candidate, 2)
     591  ClassDef(Candidate, 3)
    507592};
    508593
  • classes/DelphesLHEFReader.cc

    rf53a4d2 r28027d5  
    8282  fEventCounter = -1;
    8383  fParticleCounter = -1;
    84   fRwgtList.clear();
     84  fWeightList.clear();
    8585}
    8686
     
    9999  TObjArray *partonOutputArray)
    100100{
    101   int rc;
     101  int rc, id;
    102102  char *pch;
    103103  double weight;
     
    158158  else if(strstr(fBuffer, "<wgt"))
    159159  {
    160     pch = strstr(fBuffer, ">");
     160    pch = strpbrk(fBuffer, "\"'");
    161161    if(!pch)
    162162    {
     
    165165    }
    166166
    167     DelphesStream bufferStream(pch + 1);
    168     rc = bufferStream.ReadDbl(weight);
     167    DelphesStream idStream(pch + 1);
     168    rc = idStream.ReadInt(id);
     169
     170    pch = strchr(fBuffer, '>');
     171    if(!pch)
     172    {
     173      cerr << "** ERROR: " << "invalid weight format" << endl;
     174      return kFALSE;
     175    }
     176
     177    DelphesStream weightStream(pch + 1);
     178    rc = weightStream.ReadDbl(weight);
    169179
    170180    if(!rc)
     
    174184    }
    175185
    176     fRwgtList.push_back(weight);
     186    fWeightList.push_back(make_pair(id, weight));
    177187  }
    178188  else if(strstr(fBuffer, "</event>"))
     
    206216//---------------------------------------------------------------------------
    207217
    208 void DelphesLHEFReader::AnalyzeRwgt(ExRootTreeBranch *branch)
    209 {
    210   Weight *element;
    211   vector<double>::const_iterator itRwgtList;
    212 
    213   for(itRwgtList = fRwgtList.begin(); itRwgtList != fRwgtList.end(); ++itRwgtList)
    214   {
    215     element = static_cast<Weight *>(branch->NewEntry());
    216 
    217     element->Weight = *itRwgtList;
     218void DelphesLHEFReader::AnalyzeWeight(ExRootTreeBranch *branch)
     219{
     220  LHEFWeight *element;
     221  vector< pair< int, double > >::const_iterator itWeightList;
     222
     223  for(itWeightList = fWeightList.begin(); itWeightList != fWeightList.end(); ++itWeightList)
     224  {
     225    element = static_cast<LHEFWeight *>(branch->NewEntry());
     226
     227    element->ID = itWeightList->first;
     228    element->Weight = itWeightList->second;
    218229  }
    219230}
  • classes/DelphesLHEFReader.h

    rf53a4d2 r28027d5  
    3131
    3232#include <vector>
     33#include <utility>
    3334
    3435class TObjArray;
     
    5859    TStopwatch *readStopWatch, TStopwatch *procStopWatch);
    5960
    60   void AnalyzeRwgt(ExRootTreeBranch *branch);
     61  void AnalyzeWeight(ExRootTreeBranch *branch);
    6162
    6263private:
     
    8384  double fPx, fPy, fPz, fE, fMass;
    8485 
    85   std::vector<double> fRwgtList;
     86  std::vector< std::pair< int, double > > fWeightList;
    8687};
    8788
Note: See TracChangeset for help on using the changeset viewer.