28 #include "HepMC/SimpleVector.h"
139 std::vector<const TrackingParticle*>
tp;
140 std::vector<reco::TransientTrack>
tk;
141 std::vector<reco::TransientTrack>
tkprim;
166 std::vector<SimPart>& tsim,
167 std::vector<SimEvent>& simEvt,
168 const bool selectedOnly=
true);
175 void getTc(
const std::vector<reco::TransientTrack>&,
double &,
double &,
double &,
double &,
double&);
176 void add(std::map<std::string, TH1*>&
h, TH1*
hist){ h[hist->GetName()]=
hist; hist->StatOverflows(kTRUE);}
181 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
190 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
198 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
204 if(h.count(s+
"Signal")==0){
205 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"Signal" << std::endl;
208 h[s+
"Signal"]->Fill(x);
210 if(h.count(s+
"PU")==0){
211 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"PU" << std::endl;
220 Fill(h, s,1.,signal);
222 Fill(h, s,0.,signal);
228 if((h->GetEntries()==0) || (h->Integral()<=0) ){
229 std::cout <<
"DEBUG : Cumulate called with empty histogram " << h->GetTitle() << std::endl;
232 std::cout <<
"DEBUG : cumulating " << h->GetTitle() << std::endl;
234 h->ComputeIntegral();
235 Double_t *
integral=h->GetIntegral();
236 h->SetContent(integral);
238 std::cout <<
"DEBUG : an error occurred cumulating " << h->GetTitle() << std::endl;
240 std::cout <<
"DEBUG : cumulating " << h->GetTitle() <<
"done " << std::endl;
270 std::vector<PrimaryVertexAnalyzer4PU::SimEvent>
getSimEvents(
277 const std::vector<SimPart > & tsim,
283 std::vector<simPrimaryVertex> & simpv,
284 const std::vector<float> & pui_z,
290 std::vector<SimEvent> & simEvt,
297 std::vector<SimEvent> & simEvt,
307 HepMC::GenVertex::particles_in_const_iterator,
308 HepMC::GenVertex::particles_in_const_iterator,
309 HepMC::GenVertex::particles_out_const_iterator,
310 HepMC::GenVertex::particles_out_const_iterator
355 std::map<std::string, TH1*>
hBS;
357 std::map<std::string, TH1*>
hDA;
358 std::map<std::string, TH1*>
hPIX;
359 std::map<std::string, TH1*>
hMVF;
362 std::map<double, TrackingParticleRef>
z2tp_;
math::XYZPoint myBeamSpot
~PrimaryVertexAnalyzer4PU()
edm::EDGetTokenT< reco::TrackCollection > recoTrackCollectionToken_
TrackFilterForPVFinding theTrackFilter
std::vector< int > simTrackIndex
edm::EDGetTokenT< reco::BeamSpot > recoBeamSpotToken_
edm::EDGetTokenT< edm::SimTrackContainer > edmSimTrackContainerToken_
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< int > supf(std::vector< SimPart > &simtrks, const reco::TrackCollection &trks)
edm::EDGetTokenT< reco::VertexCollection > recoVertexCollectionToken_
std::vector< Track > TrackCollection
collection of Tracks
static bool match(const ParameterVector &a, const ParameterVector &b)
edm::ESHandle< TransientTrackBuilder > theB_
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleCollectionToken_
math::Vector< dimension >::type ParameterVector
parameter vector
std::map< double, int > ntInRecVz
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollectionToken_
edm::EDGetTokenT< edm::HepMCProduct > edmHepMCProductToken_
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::vector< float > &pui_z, const std::string message="")
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.
double getTrueSeparation(float, const std::vector< float > &)
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)
std::vector< int > * vertex_match(float, const edm::Handle< reco::VertexCollection >)
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)
edm::EDGetTokenT< edm::View< reco::Track > > edmView_recoTrack_Token_
edm::EDGetTokenT< edm::SimVertexContainer > edmSimVertexContainerToken_
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
std::vector< int > genVertex
std::string vertexString(const TrackingParticleRefVector &, const TrackingParticleRefVector &) const
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 analyzeVertexCollectionTP(std::map< std::string, TH1 * > &h, const edm::Handle< reco::VertexCollection > recVtxs, const edm::Handle< reco::TrackCollection > recTrks, std::vector< SimEvent > &simEvt, reco::RecoToSimCollection rsC, const std::string message="")
edm::EDGetTokenT< reco::VertexCollection > recoVertexCollection_DA_Token_
edm::EDGetTokenT< reco::VertexCollection > recoVertexCollection_BS_Token_
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > vecPileupSummaryInfoToken_
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_