122 std::cout <<
"in the constructor" << std::endl;
126 "/afs/cern.ch/user/c/carrillo/simhits/CMSSW_3_5_8_patch2/src/"
127 "simhitshifter/SimHitShifter/Merged_Muon_RawId_Shift.txt");
142 while (ifin.good()) {
148 produces<edm::PSimHitContainer>(
"MuonCSCHits");
149 produces<edm::PSimHitContainer>(
"MuonDTHits");
150 produces<edm::PSimHitContainer>(
"MuonRPCHits");
159 std::vector<edm::Handle<edm::PSimHitContainer> > theSimHitContainers;
160 iEvent.getManyByType(theSimHitContainers);
167 std::vector<PSimHit> theSimHits;
172 for (
int i = 0;
i <
int(theSimHitContainers.size());
i++) {
173 theSimHits.insert(theSimHits.end(), theSimHitContainers.at(
i)->begin(), theSimHitContainers.at(
i)->end());
176 for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++) {
177 DetId theDetUnitId((*iHit).detUnitId());
188 std::cout <<
"RPC Warning the RawId = " << simdetid.det() <<
" | " << simdetid.rawId() <<
"is not in the map"
190 newtof = (*iHit).timeOfFlight();
192 newtof = (*iHit).timeOfFlight() +
shiftinfo[simdetid.rawId()];
199 (*iHit).energyLoss(),
200 (*iHit).particleType(),
203 (*iHit).thetaAtEntry(),
204 (*iHit).phiAtEntry(),
205 (*iHit).processType());
206 prpc->push_back(
hit);
208 int RawId = simdetid.rawId();
209 std::cout <<
"We found a DT simhit the RawId in Dec is";
213 std::cout <<
"once masked in oct " << std::endl;
214 int compressedRawId = RawId / 8 / 8 / 8 / 8 / 8;
215 std::cout << compressedRawId << std::endl;
216 std::cout <<
"extendedRawId" << std::endl;
217 int extendedRawId = compressedRawId * 8 * 8 * 8 * 8 * 8;
219 std::cout <<
"converted again in decimal" << std::endl;
224 newtof = (*iHit).timeOfFlight();
226 newtof = (*iHit).timeOfFlight() +
shiftinfo[extendedRawId];
227 std::cout <<
"RawId = " << extendedRawId <<
"is in the map " << (*iHit).timeOfFlight() <<
" " << newtof
231 std::cout <<
"\t\t We have an DT Sim Hit! in t=" << (*iHit).timeOfFlight() <<
" DetId=" << (*iHit).detUnitId()
237 (*iHit).energyLoss(),
238 (*iHit).particleType(),
241 (*iHit).thetaAtEntry(),
242 (*iHit).phiAtEntry(),
243 (*iHit).processType());
252 std::cout <<
"The RawId is not in the map,perhaps it is on the CSCs station 1 ring 4" << std::endl;
253 if (TheChamberDetId.
station() == 1 && TheChamberDetId.
ring() == 4) {
259 TheChamberDetId.
layer());
262 std::cout <<
"CSC Warning the RawId = " << TheChamberDetIdNoring4 <<
" " << TheChamberDetIdNoring4.
rawId()
263 <<
"is not in the map" << std::endl;
264 newtof = (*iHit).timeOfFlight();
266 newtof = (*iHit).timeOfFlight() +
shiftinfo[TheChamberDetIdNoring4.
rawId()];
270 newtof = (*iHit).timeOfFlight() +
shiftinfo[TheChamberDetId.
rawId()];
277 (*iHit).energyLoss(),
278 (*iHit).particleType(),
281 (*iHit).thetaAtEntry(),
282 (*iHit).phiAtEntry(),
283 (*iHit).processType());
285 std::cout <<
"CSC check newtof" << newtof <<
" " << (*iHit).timeOfFlight() << std::endl;
286 if (newtof == (*iHit).timeOfFlight())
288 pcsc->push_back(
hit);
292 std::cout <<
"Putting collections in the event" << std::endl;