8000 Update KGenEventInfo · KIT-CMS/Kappa@26b6863 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 26b6863

Browse files
committed
Update KGenEventInfo
1 parent 2738bb3 commit 26b6863

File tree

3 files changed

+27
-28
lines changed

3 files changed

+27
-28
lines changed

DataFormats/interface/KInfo.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ typedef int bx_id;
105105

106106
struct KGenEventInfo : public KEventInfo
107107
{
108-
double weight;
109-
double binValue;
110-
double alphaQCD;
111-
float numPUInteractionsTruth; // "true" number of PU interactions
112-
unsigned char numPUInteractionsM2; // bx = -2
113-
unsigned char numPUInteractionsM1; // bx = -1
114-
unsigned char numPUInteractions0; // bx = 0
115-
unsigned char numPUInteractionsP1; // bx = +1
116-
unsigned char numPUInteractionsP2; // bx = +2
108+
double weight; //< Monte-Carlo weight of the event
109+
double binValue; //< ?
110+
double alphaQCD; //< value of alpha_S for this event
111+
float nPUMean; //< mean ("true") number of PU interactions
112+
unsigned char nPUm2; // bx = -2
113+
unsigned char nPUm1; // bx = -1
114+
unsigned char nPU; // bx = 0
115+
unsigned char nPUp1; // bx = +1
116+
unsigned char nPUp2; // bx = +2
117117
};
118118

119119

DataFormats/test/KDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ std::ostream &operator<<(std::ostream &os, const KGenEventInfo &m)
194194
os << static_cast<const KEventInfo>(m) << std::endl;
195195
return os
196196
<< "Weight: " << m.weight
197-
<< "#PU: " << m.numPUInteractionsTruth;
197+
<< "#PU: " << m.nPUMean;
198198
}
199199

200200
std::ostream &displayHLT(std::ostream &os, const KLumiInfo &metaLumi, const KEventInfo &metaEvent)

Producers/interface/KGenInfoProducer.h

-18Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,38 +82,37 @@ class KGenInfoProducer : public KInfoProducer<Tmeta>
8282
//metaEvent->alphaQED = hEventInfo->alphaQED();
8383

8484
// Get PU infos
85-
this->metaEvent->numPUInteractionsM2 = 0;
86-
this->metaEvent->numPUInteractionsM1 = 0;
87-
this->metaEvent->numPUInteractions0 = 0;
88-
this->metaEvent->numPUInteractionsP1 = 0;
89-
this->metaEvent->numPUInteractionsP2 = 0;
85+
this->metaEvent->nPUm2 = 0;
86+
this->metaEvent->nPUm1 = 0;
87+
this->metaEvent->nPU = 0;
88+
this->metaEvent->nPUp1 = 0;
89+
this->metaEvent->nPUp2 = 0;
9090
edm::Handle<std::vector<PileupSummaryInfo> > puHandles;
9191
if (event.getByLabel(puInfoSource, puHandles) && puHandles.isValid())
9292
{
9393
for (std::vector<PileupSummaryInfo>::const_iterator it = puHandles->begin(); it != puHandles->end(); ++it)
9494
{
9595
unsigned char nPU = (unsigned char)std::min(255, it->getPU_NumInteractions());
9696
if (it->getBunchCrossing() == -2)
97-
this->metaEvent->numPUInteractionsM2 = nPU;
97+
this->metaEvent->nPUm2 = nPU;
9898
else if (it->getBunchCrossing() == -1)
99-
this->metaEvent->numPUInteractionsM1 = nPU;
99+
this->metaEvent->nPUm1 = nPU;
100100
else if (it->getBunchCrossing() == 0)
101-
this->metaEvent->numPUInteractions0 = nPU;
101+
this->metaEvent->nPU = nPU;
102102
else if (it->getBunchCrossing() == 1)
103-
this->metaEvent->numPUInteractionsP1 = nPU;
103+
this->metaEvent->nPUp1 = nPU;
104104
else if (it->getBunchCrossing() == 2)
105-
this->metaEvent->numPUInteractionsP2 = nPU;
105+
this->metaEvent->nPUp2 = nPU;
106106

107-
// remove the following line to compile with CMSSW 4.2.7 or earlier
108-
this->metaEvent->numPUInteractionsTruth = it->getTrueNumInteractions();
107+
this->metaEvent->nPUMean = it->getTrueNumInteractions(); // remove this line to compile with CMSSW 4.2.7 or earlier
109108
}
110109
}
111110
else
112111
{
113112
// in some versions of CMSSW it's not a vector:
114113
edm::Handle<PileupSummaryInfo> puHandle;
115114
if (event.getByLabel(puInfoSource, puHandle) && puHandle.isValid())
116-
this->metaEvent->numPUInteractions0 = (unsigned char)std::min(255, puHandle->getPU_NumInteractions());
115+
this->metaEvent->nPU = (unsigned char)std::min(255, puHandle->getPU_NumInteractions());
117116
}
118117

119118
return true;
@@ -172,11 +171,11 @@ class KHepMCInfoProducer : public KInfoProducer<Tmeta>
172171
//metaEvent->alphaQED = hEventInfo->alphaQED();
173172

174173
// Get PU infos
175-
this->metaEvent->numPUInteractionsM2 = 0;
176-
this->metaEvent->numPUInteractionsM1 = 0;
177-
this->metaEvent->numPUInteractions0 = 0;
178-
this->metaEvent->numPUInteractionsP1 = 0;
179-
this->metaEvent->numPUInteractionsP2 = 0;
174+
this->metaEvent->nPUm2 = 0;
175+
this->metaEvent->nPUm1 = 0;
176+
this->metaEvent->nPU = 0;
177+
this->metaEvent->nPUp1 = 0;
178+
this->metaEvent->nPUp2 = 0;
180179

181180
return true;
182181
}

0 commit comments

Comments
 (0)
0