127 std::cout<<
"in the constructor"<<std::endl;
146 std::cout<<
"rawId ="<<rawId<<
" offset="<<offset<<std::endl;
149 produces<edm::PSimHitContainer>(
"MuonCSCHits");
150 produces<edm::PSimHitContainer>(
"MuonDTHits");
151 produces<edm::PSimHitContainer>(
"MuonRPCHits");
163 std::vector<edm::Handle<edm::PSimHitContainer> > theSimHitContainers;
171 std::vector<PSimHit> theSimHits;
176 for (
int i = 0;
i <
int(theSimHitContainers.size());
i++){
177 theSimHits.insert(theSimHits.end(),theSimHitContainers.at(
i)->begin(),theSimHitContainers.at(
i)->end());
180 for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++){
181 DetId theDetUnitId((*iHit).detUnitId());
191 std::cout<<
"RPC Warning the RawId = "<<simdetid.det()<<
" | "<<simdetid.rawId()<<
"is not in the map"<<std::endl;
192 newtof = (*iHit).timeOfFlight();
194 newtof = (*iHit).timeOfFlight()+
shiftinfo[simdetid.rawId()];
197 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
199 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
200 prpc->push_back(
hit);
203 int RawId = simdetid.rawId();
204 std::cout<<
"We found a DT simhit the RawId in Dec is";
208 std::cout<<
"once masked in oct "<<std::endl;
209 int compressedRawId = RawId/8/8/8/8/8;
212 int extendedRawId = compressedRawId*8*8*8*8*8;
214 std::cout<<
"converted again in decimal"<<std::endl;
219 newtof = (*iHit).timeOfFlight();
221 newtof = (*iHit).timeOfFlight()+
shiftinfo[extendedRawId];
222 std::cout<<
"RawId = "<<extendedRawId<<
"is in the map "<<(*iHit).timeOfFlight()<<
" "<<newtof<<std::endl;
225 std::cout<<
"\t\t We have an DT Sim Hit! in t="<<(*iHit).timeOfFlight()<<
" DetId="<<(*iHit).detUnitId()<<std::endl;
226 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
228 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
238 std::cout<<
"The RawId is not in the map,perhaps it is on the CSCs station 1 ring 4"<<std::endl;
239 if(TheChamberDetId.
station()==1 && TheChamberDetId.
ring()==4){
244 std::cout<<
"CSC Warning the RawId = "<<TheChamberDetIdNoring4<<
" "<<TheChamberDetIdNoring4.
rawId()<<
"is not in the map"<<std::endl;
245 newtof = (*iHit).timeOfFlight();
247 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetIdNoring4.
rawId()];
251 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetId.
rawId()];
254 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
256 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
258 std::cout<<
"CSC check newtof"<<newtof<<
" "<<(*iHit).timeOfFlight()<<std::endl;
259 if(newtof==(*iHit).timeOfFlight())
std::cout<<
"Warning!!!"<<std::endl;
260 pcsc->push_back(
hit);
264 std::cout<<
"Putting collections in the event"<<std::endl;
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
constexpr uint32_t rawId() const
get the raw id
void getManyByType(std::vector< Handle< PROD >> &results) const
#define DEFINE_FWK_MODULE(type)
SimHitShifter(const edm::ParameterSet &)
std::map< int, float > shiftinfo
CSCDetId chamberId() const
void produce(edm::Event &, const edm::EventSetup &) override
~SimHitShifter() override
void beginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< PSimHit > PSimHitContainer
std::string ShiftFileName