28 #include "HepMC/SimpleVector.h"
136 std::vector<const TrackingParticle*>
tp;
137 std::vector<reco::TransientTrack>
tk;
138 std::vector<reco::TransientTrack>
tkprim;
162 std::vector<SimPart>& tsim,
163 std::vector<SimEvent>& simEvt,
164 const bool selectedOnly=
true);
171 void getTc(
const std::vector<reco::TransientTrack>&,
double &,
double &,
double &,
double &,
double&);
172 void add(std::map<std::string, TH1*>&
h, TH1*
hist){ h[hist->GetName()]=
hist; hist->StatOverflows(kTRUE);}
176 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
184 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
192 std::cout <<
"Trying to fill non-exiting Histogram named " << s << std::endl;
198 if(h.count(s+
"Signal")==0){
199 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"Signal" << std::endl;
202 h[s+
"Signal"]->Fill(x);
204 if(h.count(s+
"PU")==0){
205 std::cout <<
"Trying to fill non-exiting Histogram named " << s+
"PU" << std::endl;
214 Fill(h, s,1.,signal);
216 Fill(h, s,0.,signal);
222 if((h->GetEntries()==0) || (h->Integral()<=0) ){
223 std::cout <<
"DEBUG : Cumulate called with empty histogram " << h->GetTitle() << std::endl;
226 std::cout <<
"DEBUG : cumulating " << h->GetTitle() << std::endl;
228 h->ComputeIntegral();
229 Double_t *
integral=h->GetIntegral();
230 h->SetContent(integral);
232 std::cout <<
"DEBUG : an error occurred cumulating " << h->GetTitle() << std::endl;
234 std::cout <<
"DEBUG : cumulating " << h->GetTitle() <<
"done " << std::endl;
264 std::vector<PrimaryVertexAnalyzer4PU::SimEvent>
getSimEvents(
271 const std::vector<SimPart > & tsim,
277 std::vector<simPrimaryVertex> & simpv,
278 const std::vector<float> & pui_z,
284 std::vector<SimEvent> & simEvt,
291 std::vector<SimEvent> & simEvt,
301 HepMC::GenVertex::particles_in_const_iterator,
302 HepMC::GenVertex::particles_in_const_iterator,
303 HepMC::GenVertex::particles_out_const_iterator,
304 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;
356 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
unsigned long long EventNumber_t
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_
unsigned int LuminosityBlockNumber_t
std::map< std::string, TH1 * > hnoBS
edm::LuminosityBlockNumber_t luminosityBlock_
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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)
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_
edm::EventNumber_t event_
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_