35 #include "HepMC/GenEvent.h"
36 #include "HepMC/GenVertex.h"
37 #include "HepMC/GenParticle.h"
147 std::vector<const TrackingParticle*>
tp;
148 std::vector<reco::TransientTrack>
tk;
149 std::vector<reco::TransientTrack>
tkprim;
174 std::vector<SimPart>& tsim,
175 std::vector<SimEvent>& simEvt,
176 const bool selectedOnly=
true);
183 void getTc(
const std::vector<reco::TransientTrack>&,
double &,
double &,
double &,
double &,
double&);
184 void add(std::map<std::string, TH1*>&
h, TH1*
hist){ h[hist->GetName()]=
hist; hist->StatOverflows(kTRUE);}
186 void Fill(std::map<std::string, TH1*>&
h, std::string
s,
double x){
189 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
195 void Fill(std::map<std::string, TH1*>&
h, std::string
s,
double x,
double y){
198 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
204 void Fill(std::map<std::string, TH1*>&
h, std::string
s,
double x,
bool signal){
206 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
212 if(h.count(s+
"Signal")==0){
213 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"Signal" << std::endl;
216 h[s+
"Signal"]->Fill(x);
218 if(h.count(s+
"PU")==0){
219 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"PU" << std::endl;
226 void Fill(std::map<std::string, TH1*>&
h, std::string
s,
bool yesno,
bool signal){
228 Fill(h, s,1.,signal);
230 Fill(h, s,0.,signal);
236 if((h->GetEntries()==0) || (h->Integral()<=0) ){
237 std::cout <<
"DEBUG : Cumulate called with empty histogram " << h->GetTitle() << std::endl;
240 std::cout <<
"DEBUG : cumulating " << h->GetTitle() << std::endl;
242 h->ComputeIntegral();
243 Double_t *
integral=h->GetIntegral();
244 h->SetContent(integral);
246 std::cout <<
"DEBUG : an error occurred cumulating " << h->GetTitle() << std::endl;
248 std::cout <<
"DEBUG : cumulating " << h->GetTitle() <<
"done " << std::endl;
275 std::vector<PrimaryVertexAnalyzer4PU::SimEvent>
getSimEvents(
282 const std::vector<SimPart > & tsim,
288 std::vector<simPrimaryVertex> & simpv,
294 std::vector<SimEvent> & simEvt,
300 std::vector<SimEvent> & simEvt,
310 HepMC::GenVertex::particles_in_const_iterator,
311 HepMC::GenVertex::particles_in_const_iterator,
312 HepMC::GenVertex::particles_out_const_iterator,
313 HepMC::GenVertex::particles_out_const_iterator
348 std::map<std::string, TH1*>
hBS;
350 std::map<std::string, TH1*>
hDA;
351 std::map<std::string, TH1*>
hPIX;
352 std::map<std::string, TH1*>
hMVF;
357 std::map<double, TrackingParticleRef>
z2tp_;
math::XYZPoint myBeamSpot
~PrimaryVertexAnalyzer4PU()
TrackFilterForPVFinding theTrackFilter
std::vector< int > simTrackIndex
const reco::Vertex * recVtx
bool matchVertex(const simPrimaryVertex &vsim, const reco::Vertex &vrec)
std::vector< SimPart > getSimTrkParameters(edm::Handle< edm::SimTrackContainer > &simTrks, edm::Handle< edm::SimVertexContainer > &simVtcs, double simUnit=1.0)
std::vector< PrimaryVertexAnalyzer4PU::SimEvent > getSimEvents(edm::Handle< TrackingParticleCollection >, edm::Handle< TrackingVertexCollection >, edm::Handle< edm::View< reco::Track > >)
void fillTrackHistos(std::map< std::string, TH1 * > &h, const std::string &ttype, const reco::Track &t, const reco::Vertex *v=NULL)
std::vector< std::string > vtxSample_
reco::TrackBase::ParameterVector ParameterVector
std::map< std::string, TH1 * > hsimPV
std::vector< const TrackingParticle * > tp
edm::Handle< reco::BeamSpot > recoBeamSpotHandle_
std::vector< reco::TransientTrack > tk
std::vector< Track > TrackCollection
collection of Tracks
static bool match(const ParameterVector &a, const ParameterVector &b)
edm::ESHandle< TransientTrackBuilder > theB_
math::Vector< dimension >::type ParameterVector
parameter vector
std::map< double, int > ntInRecVz
void printRecVtxs(const edm::Handle< reco::VertexCollection > recVtxs, std::string title="Reconstructed Vertices")
reco::BeamSpot vertexBeamSpot_
std::map< std::string, TH1 * > hnoBS
void Fill(std::map< std::string, TH1 * > &h, std::string s, double x)
std::map< std::string, TH1 * > hDA
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void analyzeVertexCollectionTP(std::map< std::string, TH1 * > &h, const edm::Handle< reco::VertexCollection > recVtxs, const edm::Handle< reco::TrackCollection > recTrks, std::vector< SimEvent > &simEvt, const std::string message="")
bool isFinalstateParticle(const HepMC::GenParticle *p)
std::string particleString(int) const
std::map< std::string, TH1 * > hMVF
bool isCharged(const HepMC::GenParticle *p)
bool truthMatchedTrack(edm::RefToBase< reco::Track >, TrackingParticleRef &)
std::map< std::string, TH1 * > bookVertexHistograms()
std::map< std::string, TH1 * > hPIX
void printPVTrks(const edm::Handle< reco::TrackCollection > &recTrks, const edm::Handle< reco::VertexCollection > &recVtxs, std::vector< SimPart > &tsim, std::vector< SimEvent > &simEvt, const bool selectedOnly=true)
std::vector< int > matchedRecTrackIndex
std::vector< simPrimaryVertex > getSimPVs(const edm::Handle< edm::HepMCProduct > evtMC)
void printSimVtxs(const edm::Handle< edm::SimVertexContainer > simVtxs)
void Fill(std::map< std::string, TH1 * > &h, std::string s, bool yesno, bool signal)
void printEventSummary(std::map< std::string, TH1 * > &h, const edm::Handle< reco::VertexCollection > recVtxs, const edm::Handle< reco::TrackCollection > recTrks, std::vector< SimEvent > &simEvt, const std::string message)
void history(const edm::Handle< edm::View< reco::Track > > &tracks, const size_t trackindex=10000)
Integral< F, X >::type integral(const F &f)
std::map< std::string, TH1 * > hBS
std::vector< reco::TransientTrack > tkprim
void Fill(std::map< std::string, TH1 * > &h, std::string s, double x, bool signal)
std::vector< reco::Track > reconstructedTracks
TrackAssociatorBase * associatorByHits_
simPrimaryVertex(double x1, double y1, double z1)
void matchRecTracksToVertex(simPrimaryVertex &pv, const std::vector< SimPart > &tsim, const edm::Handle< reco::TrackCollection > &recTrks)
bool isResonance(const HepMC::GenParticle *p)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void printRecTrks(const edm::Handle< reco::TrackCollection > &recTrks)
math::XYZTLorentzVector LorentzVector
void getTc(const std::vector< reco::TransientTrack > &, double &, double &, double &, double &, double &)
XYZPointD XYZPoint
point in space with cartesian internal representation
reco::RecoToSimCollection r2s_
std::vector< int > finalstateParticles
int * supf(std::vector< SimPart > &simtrks, const reco::TrackCollection &trks)
std::string vertexString(TrackingParticleRefVector, TrackingParticleRefVector) const
std::vector< int > genVertex
PrimaryVertexAnalyzer4PU(const edm::ParameterSet &)
void printSimTrks(const edm::Handle< edm::SimTrackContainer > simVtrks)
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
void Fill(std::map< std::string, TH1 * > &h, std::string s, double x, double y)
std::string recoTrackProducer_
void dumpHitInfo(const reco::Track &t)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< edm::RefToBase< reco::Track > > getTruthMatchedVertexTracks(const reco::Vertex &)
edm::ESHandle< ParticleDataTable > pdt_
std::vector< reco::TransientTrack > tkprimsel
std::map< double, TrackingParticleRef > z2tp_
void analyzeVertexCollection(std::map< std::string, TH1 * > &h, const edm::Handle< reco::VertexCollection > recVtxs, const edm::Handle< reco::TrackCollection > recTrks, std::vector< simPrimaryVertex > &simpv, const std::string message="")