Fork me on GitHub

Changeset 8f7db23 in git


Ignore:
Timestamp:
Apr 8, 2014, 6:43:52 PM (10 years ago)
Author:
pavel <pavel@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b67be31
Parents:
5b822e5
Message:

add HectorHit class and corresponding ROOT tree branch

Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • classes/ClassesLinkDef.h

    r5b822e5 r8f7db23  
    77 *  $Revision: 1.2 $
    88 *
    9  * 
     9 *
    1010 *  \author P. Demin - UCL, Louvain-la-Neuve
    1111 *
     
    4545#pragma link C++ class Track+;
    4646#pragma link C++ class Tower+;
     47#pragma link C++ class HectorHit+;
    4748
    4849#pragma link C++ class Candidate+;
  • classes/DelphesClasses.cc

    r5b822e5 r8f7db23  
    2626CompBase *Track::fgCompare = CompPT<Track>::Instance();
    2727CompBase *Tower::fgCompare = CompE<Tower>::Instance();
     28CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance();
    2829CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance();
    2930
  • classes/DelphesClasses.h

    r5b822e5 r8f7db23  
    390390//---------------------------------------------------------------------------
    391391
     392class HectorHit: public SortableObject
     393{
     394public:
     395  Float_t E; // reconstructed energy [GeV]
     396
     397  Float_t Tx; // angle of the momentum in the horizontal (x,z) plane [urad]
     398  Float_t Ty; // angle of the momentum in the verical (y,z) plane [urad]
     399
     400  Float_t T; // time of flight to the detector [s]
     401
     402  Float_t X; // horizontal distance to the beam [um]
     403  Float_t Y; // vertical distance to the beam [um]
     404  Float_t S; // distance to the interaction point [m]
     405
     406  static CompBase *fgCompare; //!
     407  const CompBase *GetCompare() const { return fgCompare; }
     408
     409  ClassDef(HectorHit, 1)
     410};
     411
     412//---------------------------------------------------------------------------
     413
    392414class Candidate: public SortableObject
    393415{
  • modules/Hector.cc

    r5b822e5 r8f7db23  
    6363  fBeamLineLength = GetDouble("BeamLineLength", 430.0);
    6464  fDistance = GetDouble("Distance", 420.0);
     65  fOffsetX = GetDouble("OffsetX", 0.0);
     66  fOffsetS = GetDouble("OffsetS", 120.0);
    6567  fSigmaE = GetDouble("SigmaE", 0.0);
    6668  fSigmaX = GetDouble("SigmaX", 0.0);
    6769  fSigmaY = GetDouble("SigmaY", 0.0);
     70  fSigmaT = GetDouble("SigmaT", 0.0);
    6871  fEtaMin = GetDouble("EtaMin", 5.0);
    6972
    7073  fBeamLine = new H_BeamLine(fDirection, fBeamLineLength + 0.1);
    71   fBeamLine->fill(GetString("BeamLineFile", "examples/LHCB1IR5_5TeV.tfs"), fDirection, "IP5" );
     74  fBeamLine->fill(GetString("BeamLineFile", "examples/LHCB1IR5_5TeV.tfs"), fDirection, GetString("IPName", "IP5"));
    7275  fBeamLine->offsetElements(120, -0.097*fDirection);
     76  fBeamLine->offsetElements(fOffsetS, fOffsetX);
    7377  fBeamLine->calcMatrix();
    7478
     
    8084  // create output array
    8185
    82   fOutputArray = ExportArray(GetString("OutputArray", "stableParticles"));
     86  fOutputArray = ExportArray(GetString("OutputArray", "hits"));
    8387}
    8488
     
    97101  Candidate *candidate, *mother;
    98102  Double_t pz;
    99   Double_t x, y, z, tx, ty;
     103  Double_t x, y, z, tx, ty, theta;
     104  Double_t distance, time;
     105
     106  const Double_t c_light = 2.99792458E8;
    100107
    101108  fItInputArray->Reset();
     
    118125    ty = 0.0;
    119126
     127    theta = TMath::Hypot(TMath::ATan(candidateMomentum.Px()/pz), TMath::ATan(candidateMomentum.Py()/pz));
     128    distance = (fDistance - 1.0E-3 * candidatePosition.Z())/TMath::Cos(theta);
     129    time = gRandom->Gaus((distance + 1.0E-3 * candidatePosition.T())/c_light, fSigmaT);
     130
    120131    H_BeamParticle particle(candidate->Mass, candidate->Charge);
    121132    particle.set4Momentum(candidateMomentum);
     
    133144    mother = candidate;
    134145    candidate = static_cast<Candidate*>(candidate->Clone());
    135     candidate->Position.SetXYZT(particle.getX(), particle.getY(), fDistance, 0.0);
     146    candidate->Position.SetXYZT(particle.getX(), particle.getY(), particle.getS(), time);
    136147    candidate->Momentum.SetPxPyPzE(particle.getTX(), particle.getTY(), 0.0, particle.getE());
    137148    candidate->AddCandidate(mother);
  • modules/Hector.h

    r5b822e5 r8f7db23  
    3434
    3535  Int_t fDirection;
    36  
     36
    3737  Double_t fBeamLineLength, fDistance;
    38   Double_t fSigmaE, fSigmaX, fSigmaY;
     38  Double_t fOffsetX, fOffsetS;
     39  Double_t fSigmaE, fSigmaX, fSigmaY, fSigmaT;
    3940  Double_t fEtaMin;
    40  
     41
    4142  H_BeamLine *fBeamLine;
    4243
  • modules/TreeWriter.cc

    r5b822e5 r8f7db23  
    6767  fClassMap[Rho::Class()] = &TreeWriter::ProcessRho;
    6868  fClassMap[Weight::Class()] = &TreeWriter::ProcessWeight;
     69  fClassMap[HectorHit::Class()] = &TreeWriter::ProcessHectorHit;
    6970
    7071  TBranchMap::iterator itBranchMap;
     
    9596      continue;
    9697    }
    97    
     98
    9899    itClassMap = fClassMap.find(branchClass);
    99100    if(itClassMap == fClassMap.end())
     
    160161  GenParticle *entry = 0;
    161162  Double_t pt, signPz, cosTheta, eta, rapidity;
    162  
    163   const Double_t c_light = 2.99792458E8;
    164  
     163
     164  const Double_t c_light = 2.99792458E8;
     165
    165166  // loop over all particles
    166167  iterator.Reset();
     
    220221  Candidate *candidate = 0;
    221222  Vertex *entry = 0;
    222  
     223
    223224  const Double_t c_light = 2.99792458E8;
    224225
     
    248249  Double_t pt, signz, cosTheta, eta, rapidity;
    249250  const Double_t c_light = 2.99792458E8;
    250  
     251
    251252  // loop over all tracks
    252253  iterator.Reset();
     
    310311  Double_t pt, signPz, cosTheta, eta, rapidity;
    311312  const Double_t c_light = 2.99792458E8;
    312  
     313
    313314  // loop over all towers
    314315  iterator.Reset();
     
    317318    const TLorentzVector &momentum = candidate->Momentum;
    318319    const TLorentzVector &position = candidate->Position;
    319    
     320
    320321    pt = momentum.Pt();
    321322    cosTheta = TMath::Abs(momentum.CosTheta());
     
    339340    entry->Edges[2] = candidate->Edges[2];
    340341    entry->Edges[3] = candidate->Edges[3];
    341    
     342
    342343    entry->T = position.T()*1.0E-3/c_light;
    343    
     344
    344345    FillParticles(candidate, &entry->Particles);
    345346  }
     
    355356  Double_t pt, signPz, cosTheta, eta, rapidity;
    356357  const Double_t c_light = 2.99792458E8;
    357  
     358
    358359  array->Sort();
    359360
     
    365366    const TLorentzVector &momentum = candidate->Momentum;
    366367    const TLorentzVector &position = candidate->Position;
    367    
     368
    368369
    369370    pt = momentum.Pt();
     
    379380    entry->PT = pt;
    380381    entry->E = momentum.E();
    381    
     382
    382383    entry->T = position.T()*1.0E-3/c_light;
    383    
     384
    384385    entry->EhadOverEem = candidate->Eem > 0.0 ? candidate->Ehad/candidate->Eem : 999.9;
    385386
     
    397398  Double_t pt, signPz, cosTheta, eta, rapidity;
    398399  const Double_t c_light = 2.99792458E8;
    399  
     400
    400401  array->Sort();
    401402
     
    406407    const TLorentzVector &momentum = candidate->Momentum;
    407408    const TLorentzVector &position = candidate->Position;
    408    
     409
    409410    pt = momentum.Pt();
    410411    cosTheta = TMath::Abs(momentum.CosTheta());
     
    418419    entry->Phi = momentum.Phi();
    419420    entry->PT = pt;
    420    
     421
    421422    entry->T = position.T()*1.0E-3/c_light;
    422    
     423
    423424    entry->Charge = candidate->Charge;
    424425
     
    437438  Muon *entry = 0;
    438439  Double_t pt, signPz, cosTheta, eta, rapidity;
    439  
    440   const Double_t c_light = 2.99792458E8;
    441  
     440
     441  const Double_t c_light = 2.99792458E8;
     442
    442443  array->Sort();
    443444
     
    448449    const TLorentzVector &momentum = candidate->Momentum;
    449450    const TLorentzVector &position = candidate->Position;
    450    
     451
    451452
    452453    pt = momentum.Pt();
     
    466467
    467468    entry->T = position.T()*1.0E-3/c_light;
    468    
     469
    469470   // cout<<entry->PT<<","<<entry->T<<endl;
    470471
     
    485486  Double_t ecalEnergy, hcalEnergy;
    486487  const Double_t c_light = 2.99792458E8;
    487  
     488
    488489  array->Sort();
    489490
     
    493494  {
    494495    TIter itConstituents(candidate->GetCandidates());
    495    
    496     const TLorentzVector &momentum = candidate->Momentum;
    497     const TLorentzVector &position = candidate->Position;
    498    
     496
     497    const TLorentzVector &momentum = candidate->Momentum;
     498    const TLorentzVector &position = candidate->Position;
     499
    499500    pt = momentum.Pt();
    500501    cosTheta = TMath::Abs(momentum.CosTheta());
     
    510511
    511512    entry->T = position.T()*1.0E-3/c_light;
    512    
     513
    513514    entry->Mass = momentum.M();
    514515
     
    533534
    534535    entry->EhadOverEem = ecalEnergy > 0.0 ? hcalEnergy/ecalEnergy : 999.9;
    535  
     536
    536537    //---   Pile-Up Jet ID variables ----
    537538
     
    632633//------------------------------------------------------------------------------
    633634
     635void TreeWriter::ProcessHectorHit(ExRootTreeBranch *branch, TObjArray *array)
     636{
     637  TIter iterator(array);
     638  Candidate *candidate = 0;
     639  HectorHit *entry = 0;
     640
     641  // loop over all roman pot hits
     642  iterator.Reset();
     643  while((candidate = static_cast<Candidate*>(iterator.Next())))
     644  {
     645    const TLorentzVector &position = candidate->Position;
     646    const TLorentzVector &momentum = candidate->Momentum;
     647
     648    entry = static_cast<HectorHit*>(branch->NewEntry());
     649
     650    entry->E = momentum.E();
     651
     652    entry->Tx = momentum.Px();
     653    entry->Ty = momentum.Py();
     654
     655    entry->T = position.T();
     656
     657    entry->X = position.X();
     658    entry->Y = position.Y();
     659    entry->S = position.Z();
     660  }
     661}
     662
     663//------------------------------------------------------------------------------
     664
    634665void TreeWriter::Process()
    635666{
  • modules/TreeWriter.h

    r5b822e5 r8f7db23  
    5353  void ProcessRho(ExRootTreeBranch *branch, TObjArray *array);
    5454  void ProcessWeight(ExRootTreeBranch *branch, TObjArray *array);
     55  void ProcessHectorHit(ExRootTreeBranch *branch, TObjArray *array);
    5556
    5657#ifndef __CINT__
Note: See TracChangeset for help on using the changeset viewer.