68 #include "FastSimulation/Tracking/test/FastTrackAnalyzer.h"
122 virtual void endJob()
override ;
128 std::cout<<
"in the constructor"<<std::endl;
147 std::cout<<
"rawId ="<<rawId<<
" offset="<<offset<<std::endl;
150 produces<edm::PSimHitContainer>(
"MuonCSCHits");
151 produces<edm::PSimHitContainer>(
"MuonDTHits");
152 produces<edm::PSimHitContainer>(
"MuonRPCHits");
164 std::vector<edm::Handle<edm::PSimHitContainer> > theSimHitContainers;
172 std::vector<PSimHit> theSimHits;
177 for (
int i = 0;
i < int(theSimHitContainers.size());
i++){
178 theSimHits.insert(theSimHits.end(),theSimHitContainers.at(
i)->begin(),theSimHitContainers.at(
i)->end());
181 for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++){
182 DetId theDetUnitId((*iHit).detUnitId());
192 std::cout<<
"RPC Warning the RawId = "<<simdetid.det()<<
" | "<<simdetid.rawId()<<
"is not in the map"<<std::endl;
193 newtof = (*iHit).timeOfFlight();
195 newtof = (*iHit).timeOfFlight()+
shiftinfo[simdetid.rawId()];
198 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
200 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
201 prpc->push_back(
hit);
204 int RawId = simdetid.rawId();
205 std::cout<<
"We found a DT simhit the RawId in Dec is";
209 std::cout<<
"once masked in oct "<<std::endl;
210 int compressedRawId = RawId/8/8/8/8/8;
213 int extendedRawId = compressedRawId*8*8*8*8*8;
215 std::cout<<
"converted again in decimal"<<std::endl;
220 newtof = (*iHit).timeOfFlight();
222 newtof = (*iHit).timeOfFlight()+
shiftinfo[extendedRawId];
223 std::cout<<
"RawId = "<<extendedRawId<<
"is in the map "<<(*iHit).timeOfFlight()<<
" "<<newtof<<std::endl;
226 std::cout<<
"\t\t We have an DT Sim Hit! in t="<<(*iHit).timeOfFlight()<<
" DetId="<<(*iHit).detUnitId()<<std::endl;
227 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
229 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
239 std::cout<<
"The RawId is not in the map,perhaps it is on the CSCs station 1 ring 4"<<std::endl;
240 if(TheChamberDetId.
station()==1 && TheChamberDetId.
ring()==4){
245 std::cout<<
"CSC Warning the RawId = "<<TheChamberDetIdNoring4<<
" "<<TheChamberDetIdNoring4.
rawId()<<
"is not in the map"<<std::endl;
246 newtof = (*iHit).timeOfFlight();
248 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetIdNoring4.
rawId()];
252 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetId.
rawId()];
255 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
257 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
259 std::cout<<
"CSC check newtof"<<newtof<<
" "<<(*iHit).timeOfFlight()<<std::endl;
260 if(newtof==(*iHit).timeOfFlight())
std::cout<<
"Warning!!!"<<std::endl;
261 pcsc->push_back(
hit);
265 std::cout<<
"Putting collections in the event"<<std::endl;
267 iEvent.
put(pcsc,
"MuonCSCHits");
268 iEvent.
put(pdt,
"MuonDTHits");
269 iEvent.
put(prpc,
"MuonRPCHits");
void getManyByType(std::vector< Handle< PROD > > &results) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
virtual void endJob() override
uint32_t rawId() const
get the raw id
SimHitShifter(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::map< int, float > shiftinfo
CSCDetId chamberId() const
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
std::vector< PSimHit > PSimHitContainer
std::string ShiftFileName