36 #include "HepMC/GenEvent.h"
37 #include "HepMC/GenVertex.h"
38 #include "HepMC/GenParticle.h"
148 std::vector<const TrackingParticle*>
tp;
149 std::vector<reco::TransientTrack>
tk;
150 std::vector<reco::TransientTrack>
tkprim;
175 std::vector<SimPart>& tsim,
176 std::vector<SimEvent>& simEvt,
177 const bool selectedOnly=
true);
184 void getTc(
const std::vector<reco::TransientTrack>&,
double &,
double &,
double &,
double &,
double&);
185 void add(std::map<std::string, TH1*>&
h, TH1*
hist){ h[hist->GetName()]=
hist; hist->StatOverflows(kTRUE);}
190 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
199 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
207 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
213 if(h.count(s+
"Signal")==0){
214 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"Signal" << std::endl;
217 h[s+
"Signal"]->Fill(x);
219 if(h.count(s+
"PU")==0){
220 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"PU" << std::endl;
229 Fill(h, s,1.,signal);
231 Fill(h, s,0.,signal);
237 if((h->GetEntries()==0) || (h->Integral()<=0) ){
238 std::cout <<
"DEBUG : Cumulate called with empty histogram " << h->GetTitle() << std::endl;
241 std::cout <<
"DEBUG : cumulating " << h->GetTitle() << std::endl;
243 h->ComputeIntegral();
244 Double_t *
integral=h->GetIntegral();
245 h->SetContent(integral);
247 std::cout <<
"DEBUG : an error occurred cumulating " << h->GetTitle() << std::endl;
249 std::cout <<
"DEBUG : cumulating " << h->GetTitle() <<
"done " << std::endl;
276 std::vector<PrimaryVertexAnalyzer4PU::SimEvent>
getSimEvents(
283 const std::vector<SimPart > & tsim,
289 std::vector<simPrimaryVertex> & simpv,
295 std::vector<SimEvent> & simEvt,
301 std::vector<SimEvent> & simEvt,
311 HepMC::GenVertex::particles_in_const_iterator,
312 HepMC::GenVertex::particles_in_const_iterator,
313 HepMC::GenVertex::particles_out_const_iterator,
314 HepMC::GenVertex::particles_out_const_iterator
349 std::map<std::string, TH1*>
hBS;
351 std::map<std::string, TH1*>
hDA;
352 std::map<std::string, TH1*>
hPIX;
353 std::map<std::string, TH1*>
hMVF;
358 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="")