60 produces< std::vector<PileupSummaryInfo> >();
61 produces<int>(
"bunchSpacing");
69 std::auto_ptr<std::vector<PileupSummaryInfo> > PSIVector(
new std::vector<PileupSummaryInfo>);
74 std::vector<int> BunchCrossings;
75 std::vector<int> Interactions_Xing;
76 std::vector<float> TrueInteractions_Xing;
77 std::vector< std::vector<edm::EventID> > eventInfoList_Xing;
91 unsigned int totalIntPU=0;
93 for(
int ib=0;
ib<(int)bunchCrossing.size(); ++
ib){
95 BunchCrossings.push_back(bunchCrossing[
ib]);
96 Interactions_Xing.push_back(interactions[ib]);
97 TrueInteractions_Xing.push_back(TrueInteractions[ib]);
99 std::vector<edm::EventID> eventInfos;
100 eventInfos.reserve( interactions[ib] );
101 for (
int pu=0; pu< interactions[
ib]; pu++) {
102 eventInfos.push_back(eventInfoList[totalIntPU+pu]);
104 totalIntPU+=(interactions[
ib]);
105 eventInfoList_Xing.push_back(eventInfos);
111 throw cms::Exception(
"PileupInformation") <<
" PileupMixingContent is missing from the event.\n"
112 "There must be some breakdown in the Simulation Chain.\n"
113 "You must run the MixingModule before calling this routine.";
124 std::vector< std::vector<float> > ptHatList_Xing;
125 std::vector< std::vector<float> > zPosList_Xing;
127 bool Have_pThats =
false;
137 const std::vector<float> PtHatInput = MixVtxInfo->
getMix_pT_hats();
138 const std::vector<float> ZposInput = MixVtxInfo->
getMix_z_Vtxs();
142 unsigned int totalIntPU=0;
144 for(
int ib=0;
ib<(int)bunchCrossing.size(); ++
ib){
147 std::vector<float> zposBX;
148 std::vector<float> pthatBX;
149 zposBX.reserve( interactions[
ib] );
150 pthatBX.reserve( interactions[ib] );
151 for (
int pu=0; pu< interactions[
ib]; pu++) {
152 zposBX.push_back(ZposInput[totalIntPU+pu]);
153 pthatBX.push_back(PtHatInput[totalIntPU+pu]);
155 totalIntPU+=(interactions[
ib]);
156 zPosList_Xing.push_back(zposBX);
157 ptHatList_Xing.push_back(pthatBX);
177 bool HaveTrackingParticles =
false;
182 TrackingVertexCollection::const_iterator iVtx;
183 TrackingVertexCollection::const_iterator iVtxTest;
184 TrackingParticleCollection::const_iterator iTrackTest;
190 HaveTrackingParticles =
true;
192 iVtxTest = mergedVH->begin();
193 iTrackTest = mergedPH->begin();
202 std::vector<int>::iterator BXIter;
203 std::vector<int>::iterator InteractionsIter = Interactions_Xing.begin();
204 std::vector<float>::iterator TInteractionsIter = TrueInteractions_Xing.begin();
205 std::vector< std::vector<edm::EventID> >::iterator TEventInfoIter = eventInfoList_Xing.begin();
207 std::vector< std::vector<float> >::iterator zPosIter;
208 std::vector< std::vector<float> >::iterator pThatIter;
211 zPosIter = zPosList_Xing.begin();
212 pThatIter = ptHatList_Xing.begin();
217 for( BXIter = BunchCrossings.begin(); BXIter != BunchCrossings.end(); ++BXIter, ++InteractionsIter, ++TInteractionsIter, ++TEventInfoIter) {
221 if(HaveTrackingParticles) {
223 for (iVtx = iVtxTest; iVtx != mergedVH->end(); ++iVtx) {
225 if(iVtx->eventId().bunchCrossing() == (*BXIter) ) {
227 if(iVtx->eventId().event() != lastEvent) {
232 zpos = iVtx->position().z();
239 lastEvent = iVtx->eventId().event();
255 for (TrackingParticleCollection::const_iterator iTrack = iTrackTest; iTrack != mergedPH->end(); ++iTrack)
257 bool FoundTrk =
false;
261 if(iTrack->eventId().bunchCrossing() == (*BXIter) && iTrack->eventId().event() > 0 )
264 int correct_index =
event_index_[iTrack->eventId().event()];
269 if(iTrack->matchedHit()>0) {
270 if(fabs(iTrack->parentVertex()->position().z()-zpos)<0.1) {
272 float Tpx = iTrack->p4().px();
273 float Tpy = iTrack->p4().py();
274 float TpT =
sqrt(Tpx*Tpx + Tpy*Tpy);
289 iTrackTest = --iTrack;
306 if(!HaveTrackingParticles) {
328 (*TInteractionsIter),
331 PSIVector->push_back(PSI_bunch);
338 std::vector<float> zposZeros( (*TEventInfoIter).size(), 0);
339 std::vector<float> pThatZeros( (*TEventInfoIter).size(), 0);
351 (*TInteractionsIter),
355 PSIVector->push_back(PSI_bunch);
388 event.put(PSIVector);
391 std::auto_ptr<int> bunchSpacingP(
new int(bunchSpacing));
392 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="")