58 produces< std::vector<PileupSummaryInfo> >();
59 produces<int>(
"bunchSpacing");
67 std::auto_ptr<std::vector<PileupSummaryInfo> > PSIVector(
new std::vector<PileupSummaryInfo>);
73 std::vector<PileupSummaryInfo>::const_iterator PSiter;
75 for(PSiter = psiInput.
product()->begin(); PSiter != psiInput.
product()->end(); PSiter++){
77 PSIVector->push_back(*PSiter);
83 int bunchSpacing=*(bsInput.
product());
88 std::auto_ptr<int> bunchSpacingP(
new int(bunchSpacing));
89 event.put(bunchSpacingP,
"bunchSpacing");
97 std::vector<int> BunchCrossings;
98 std::vector<int> Interactions_Xing;
99 std::vector<float> TrueInteractions_Xing;
100 std::vector< std::vector<edm::EventID> > eventInfoList_Xing;
114 unsigned int totalIntPU=0;
116 for(
int ib=0;
ib<(int)bunchCrossing.size(); ++
ib){
118 BunchCrossings.push_back(bunchCrossing[
ib]);
119 Interactions_Xing.push_back(interactions[ib]);
120 TrueInteractions_Xing.push_back(TrueInteractions[ib]);
122 std::vector<edm::EventID> eventInfos;
123 eventInfos.reserve( interactions[ib] );
124 for (
int pu=0; pu< interactions[
ib]; pu++) {
125 eventInfos.push_back(eventInfoList[totalIntPU+pu]);
127 totalIntPU+=(interactions[
ib]);
128 eventInfoList_Xing.push_back(eventInfos);
134 throw cms::Exception(
"PileupInformation") <<
" PileupMixingContent is missing from the event.\n"
135 "There must be some breakdown in the Simulation Chain.\n"
136 "You must run the MixingModule before calling this routine.";
147 std::vector< std::vector<float> > ptHatList_Xing;
148 std::vector< std::vector<float> > zPosList_Xing;
150 bool Have_pThats =
false;
160 const std::vector<float> PtHatInput = MixVtxInfo->
getMix_pT_hats();
161 const std::vector<float> ZposInput = MixVtxInfo->
getMix_z_Vtxs();
165 unsigned int totalIntPU=0;
167 for(
int ib=0;
ib<(int)bunchCrossing.size(); ++
ib){
170 std::vector<float> zposBX;
171 std::vector<float> pthatBX;
172 zposBX.reserve( interactions[
ib] );
173 pthatBX.reserve( interactions[ib] );
174 for (
int pu=0; pu< interactions[
ib]; pu++) {
175 zposBX.push_back(ZposInput[totalIntPU+pu]);
176 pthatBX.push_back(PtHatInput[totalIntPU+pu]);
178 totalIntPU+=(interactions[
ib]);
179 zPosList_Xing.push_back(zposBX);
180 ptHatList_Xing.push_back(pthatBX);
200 bool HaveTrackingParticles =
false;
205 TrackingVertexCollection::const_iterator iVtx;
206 TrackingVertexCollection::const_iterator iVtxTest;
207 TrackingParticleCollection::const_iterator iTrackTest;
213 HaveTrackingParticles =
true;
215 iVtxTest = mergedVH->begin();
216 iTrackTest = mergedPH->begin();
225 std::vector<int>::iterator BXIter;
226 std::vector<int>::iterator InteractionsIter = Interactions_Xing.begin();
227 std::vector<float>::iterator TInteractionsIter = TrueInteractions_Xing.begin();
228 std::vector< std::vector<edm::EventID> >::iterator TEventInfoIter = eventInfoList_Xing.begin();
230 std::vector< std::vector<float> >::iterator zPosIter;
231 std::vector< std::vector<float> >::iterator pThatIter;
234 zPosIter = zPosList_Xing.begin();
235 pThatIter = ptHatList_Xing.begin();
240 for( BXIter = BunchCrossings.begin(); BXIter != BunchCrossings.end(); ++BXIter, ++InteractionsIter, ++TInteractionsIter, ++TEventInfoIter) {
244 if(HaveTrackingParticles) {
246 for (iVtx = iVtxTest; iVtx != mergedVH->end(); ++iVtx) {
248 if(iVtx->eventId().bunchCrossing() == (*BXIter) ) {
250 if(iVtx->eventId().event() != lastEvent) {
255 zpos = iVtx->position().z();
262 lastEvent = iVtx->eventId().event();
278 for (TrackingParticleCollection::const_iterator iTrack = iTrackTest; iTrack != mergedPH->end(); ++iTrack)
280 bool FoundTrk =
false;
284 if(iTrack->eventId().bunchCrossing() == (*BXIter) && iTrack->eventId().event() > 0 )
287 int correct_index =
event_index_[iTrack->eventId().event()];
292 if(iTrack->matchedHit()>0) {
293 if(fabs(iTrack->parentVertex()->position().z()-zpos)<0.1) {
295 float Tpx = iTrack->p4().px();
296 float Tpy = iTrack->p4().py();
297 float TpT =
sqrt(Tpx*Tpx + Tpy*Tpy);
312 iTrackTest = --iTrack;
329 if(!HaveTrackingParticles) {
351 (*TInteractionsIter),
354 PSIVector->push_back(PSI_bunch);
361 std::vector<float> zposZeros( (*TEventInfoIter).size(), 0);
362 std::vector<float> pThatZeros( (*TEventInfoIter).size(), 0);
374 (*TInteractionsIter),
378 PSIVector->push_back(PSI_bunch);
411 event.put(PSIVector);
414 std::auto_ptr<int> bunchSpacingP(
new int(bunchSpacing));
415 event.put(bunchSpacingP,
"bunchSpacing");
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::vector< float > & getMix_TrueInteractions() const
#define DEFINE_FWK_MODULE(type)
const std::vector< int > & getMix_bunchCrossing() const
const std::vector< float > & getMix_pT_hats() const
const std::vector< int > & getMix_Ninteractions() const
const std::vector< edm::EventID > getMix_eventInfo() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Container::value_type value_type
T const * product() const
const std::vector< float > & getMix_z_Vtxs() const
const int & getMix_bunchSpacing() const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")