28 for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
29 iParam != parameterNames.end(); iParam++ ){
34 const int kMaxMcTruth = 10000;
35 mcpid =
new int[kMaxMcTruth];
37 mcvx =
new float[kMaxMcTruth];
38 mcvy =
new float[kMaxMcTruth];
39 mcvz =
new float[kMaxMcTruth];
40 mcpt =
new float[kMaxMcTruth];
41 mceta =
new float[kMaxMcTruth];
42 mcphi =
new float[kMaxMcTruth];
45 HltTree->Branch(
"NMCpart",&
nmcpart,
"NMCpart/I");
46 HltTree->Branch(
"MCpid",
mcpid,
"MCpid[NMCpart]/I");
47 HltTree->Branch(
"MCstatus",
mcstatus,
"MCstatus[NMCpart]/I");
48 HltTree->Branch(
"MCvtxX",
mcvx,
"MCvtxX[NMCpart]/F");
49 HltTree->Branch(
"MCvtxY",
mcvy,
"MCvtxY[NMCpart]/F");
50 HltTree->Branch(
"MCvtxZ",
mcvz,
"MCvtxZ[NMCpart]/F");
51 HltTree->Branch(
"MCpt",
mcpt,
"MCpt[NMCpart]/F");
52 HltTree->Branch(
"MCeta",
mceta,
"MCeta[NMCpart]/F");
53 HltTree->Branch(
"MCphi",
mcphi,
"MCphi[NMCpart]/F");
54 HltTree->Branch(
"MCPtHat",&
pthatf,
"MCPtHat/F");
55 HltTree->Branch(
"MCmu3",&
nmu3,
"MCmu3/I");
56 HltTree->Branch(
"MCel3",&
nel3,
"MCel3/I");
57 HltTree->Branch(
"MCbb",&
nbb,
"MCbb/I");
58 HltTree->Branch(
"MCab",&
nab,
"MCab/I");
59 HltTree->Branch(
"MCWenu",&
nwenu,
"MCWenu/I");
60 HltTree->Branch(
"MCWmunu",&
nwmunu,
"MCmunu/I");
61 HltTree->Branch(
"MCZee",&
nzee,
"MCZee/I");
62 HltTree->Branch(
"MCZmumu",&
nzmumu,
"MCZmumu/I");
63 HltTree->Branch(
"MCptEleMax",&
ptEleMax,
"MCptEleMax/F");
64 HltTree->Branch(
"MCptMuMax",&
ptMuMax,
"MCptMuMax/F");
65 HltTree->Branch(
"NPUTrueBX0",&
npubx0,
"NPUTrueBX0/I");
66 HltTree->Branch(
"NPUgenBX0",&
npuvertbx0,
"NPUgenBX0/I");
72 const edm::Handle<std::vector<SimTrack> > & simTracks,
73 const edm::Handle<std::vector<SimVertex> > & simVertices,
74 const edm::Handle<std::vector< PileupSummaryInfo > > & PupInfo,
100 if((simTracks.isValid())&&(simVertices.isValid())){
101 for (
unsigned int j=0;
j<simTracks->size();
j++) {
102 int pdgid = simTracks->at(
j).type();
103 if (
abs(pdgid)!=13)
continue;
104 double pt = simTracks->at(
j).momentum().pt();
105 if (pt<5.0)
continue;
106 double eta = simTracks->at(
j).momentum().eta();
107 if (
abs(eta)>2.5)
continue;
108 if (simTracks->at(
j).noVertex())
continue;
109 int vertIndex = simTracks->at(
j).vertIndex();
110 double x = simVertices->at(vertIndex).position().x();
111 double y = simVertices->at(vertIndex).position().y();
112 double r =
sqrt(x*x+y*y);
113 if (r>150.)
continue;
114 double z = simVertices->at(vertIndex).position().z();
115 if (
abs(z)>300.)
continue;
121 std::vector<PileupSummaryInfo>::const_iterator PVI;
122 for(PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) {
124 int BX = PVI->getBunchCrossing();
125 npvtrue = PVI->getTrueNumInteractions();
126 npuvert = PVI->getPU_NumInteractions();
139 for (
size_t i = 0;
i < mctruth->size(); ++
i) {
153 for (
size_t j=0;
j != idg; ++
j){
155 if ((d.
pdgId()==11)||(d.
pdgId()==-11)){wel += 1;}
156 if ((d.
pdgId()==13)||(d.
pdgId()==-13)){wmu += 1;}
161 if (
mcpid[nmc]==23) {
163 for (
size_t j=0;
j != idg; ++
j){
165 if (d.
pdgId()==11){zee += 1;}
166 if (d.
pdgId()==-11){zee += 2;}
167 if (d.
pdgId()==13){zmumu += 1;}
168 if (d.
pdgId()==-13){zmumu += 2;}
175 if (((
mcpid[nmc]==11)||(
mcpid[nmc]==-11))&&(
mcpt[nmc]>5.0)) {el3 += 1;}
177 if (
mcpid[nmc]==-5) {mab += 1;}
178 if (
mcpid[nmc]==5) {mbb += 1;}
198 if((zee%3)==0){
nzee = zee/3;}
200 if ((zmumu%3)==0){
nzmumu = zmumu/3;}
T getParameter(std::string const &) const
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
virtual double vx() const =0
x coordinate of vertex position
virtual double vy() const =0
y coordinate of vertex position
virtual size_type numberOfDaughters() const =0
number of daughters
std::vector< std::string > getParameterNames() const
virtual int pdgId() const =0
PDG identifier.
void analyze(const edm::Handle< reco::CandidateView > &mctruth, const double &pthat, const edm::Handle< std::vector< SimTrack > > &simTracks, const edm::Handle< std::vector< SimVertex > > &simVertices, const edm::Handle< std::vector< PileupSummaryInfo > > &PupInfo, TTree *tree)
virtual double vz() const =0
z coordinate of vertex position
void setup(const edm::ParameterSet &pSet, TTree *tree)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity