Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/Hector.cc

    r341014c rcab38f6  
    1717 */
    1818
     19
    1920/** \class Hector
    2021 *
     
    3132#include "classes/DelphesFormula.h"
    3233
     34#include "ExRootAnalysis/ExRootResult.h"
     35#include "ExRootAnalysis/ExRootFilter.h"
    3336#include "ExRootAnalysis/ExRootClassifier.h"
    34 #include "ExRootAnalysis/ExRootFilter.h"
    35 #include "ExRootAnalysis/ExRootResult.h"
    3637
     38#include "TMath.h"
     39#include "TString.h"
     40#include "TFormula.h"
     41#include "TRandom3.h"
     42#include "TObjArray.h"
    3743#include "TDatabasePDG.h"
    38 #include "TFormula.h"
    3944#include "TLorentzVector.h"
    40 #include "TMath.h"
    41 #include "TObjArray.h"
    42 #include "TRandom3.h"
    43 #include "TString.h"
    4445
    4546#include <algorithm>
     47#include <stdexcept>
    4648#include <iostream>
    4749#include <sstream>
    48 #include <stdexcept>
    4950
    5051#include "Hector/H_BeamLine.h"
     52#include "Hector/H_RecRPObject.h"
    5153#include "Hector/H_BeamParticle.h"
    52 #include "Hector/H_RecRPObject.h"
    5354
    5455using namespace std;
     
    119120
    120121  fItInputArray->Reset();
    121   while((candidate = static_cast<Candidate *>(fItInputArray->Next())))
     122  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
    122123  {
    123124    const TLorentzVector &candidatePosition = candidate->Position;
     
    131132    z = 1.0E-3 * candidatePosition.Z();
    132133
    133     //    tx = 1.0E6 * TMath::ATan(candidateMomentum.Px()/pz);
    134     //    ty = 1.0E6 * TMath::ATan(candidateMomentum.Py()/pz);
     134//    tx = 1.0E6 * TMath::ATan(candidateMomentum.Px()/pz);
     135//    ty = 1.0E6 * TMath::ATan(candidateMomentum.Py()/pz);
    135136
    136137    tx = 0.0;
    137138    ty = 0.0;
    138139
    139     theta = TMath::Hypot(TMath::ATan(candidateMomentum.Px() / pz), TMath::ATan(candidateMomentum.Py() / pz));
    140     distance = (fDistance - 1.0E-3 * candidatePosition.Z()) / TMath::Cos(theta);
    141     time = gRandom->Gaus((distance + 1.0E-3 * candidatePosition.T()) / c_light, fSigmaT);
     140    theta = TMath::Hypot(TMath::ATan(candidateMomentum.Px()/pz), TMath::ATan(candidateMomentum.Py()/pz));
     141    distance = (fDistance - 1.0E-3 * candidatePosition.Z())/TMath::Cos(theta);
     142    time = gRandom->Gaus((distance + 1.0E-3 * candidatePosition.T())/c_light, fSigmaT);
    142143
    143144    H_BeamParticle particle(candidate->Mass, candidate->Charge);
    144     //    particle.set4Momentum(candidateMomentum);
    145     particle.set4Momentum(candidateMomentum.Px(), candidateMomentum.Py(),
    146       candidateMomentum.Pz(), candidateMomentum.E());
     145//    particle.set4Momentum(candidateMomentum);
     146    particle.set4Momentum(candidateMomentum.Px(), candidateMomentum.Py(), 
     147                          candidateMomentum.Pz(), candidateMomentum.E());
    147148    particle.setPosition(x, y, tx, ty, z);
    148149
     
    157158
    158159    mother = candidate;
    159     candidate = static_cast<Candidate *>(candidate->Clone());
     160    candidate = static_cast<Candidate*>(candidate->Clone());
    160161    candidate->Position.SetXYZT(particle.getX(), particle.getY(), particle.getS(), time);
    161162    candidate->Momentum.SetPxPyPzE(particle.getTX(), particle.getTY(), 0.0, particle.getE());
Note: See TracChangeset for help on using the changeset viewer.