69 #include "FastSimulation/Tracking/test/FastTrackAnalyzer.h"
129 std::cout<<
"in the constructor"<<std::endl;
131 ShiftFileName = iConfig.
getUntrackedParameter<std::string>(
"ShiftFileName",
"/afs/cern.ch/user/c/carrillo/simhits/CMSSW_3_5_8_patch2/src/simhitshifter/SimHitShifter/Merged_Muon_RawId_Shift.txt");
148 std::cout<<
"rawId ="<<rawId<<
" offset="<<offset<<std::endl;
151 produces<edm::PSimHitContainer>(
"MuonCSCHits");
152 produces<edm::PSimHitContainer>(
"MuonDTHits");
153 produces<edm::PSimHitContainer>(
"MuonRPCHits");
165 std::vector<edm::Handle<edm::PSimHitContainer> > theSimHitContainers;
173 std::vector<PSimHit> theSimHits;
178 for (
int i = 0;
i < int(theSimHitContainers.size());
i++){
179 theSimHits.insert(theSimHits.end(),theSimHitContainers.at(
i)->begin(),theSimHitContainers.at(
i)->end());
182 for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++){
183 DetId theDetUnitId((*iHit).detUnitId());
193 std::cout<<
"RPC Warning the RawId = "<<simdetid.det()<<
" | "<<simdetid.rawId()<<
"is not in the map"<<std::endl;
194 newtof = (*iHit).timeOfFlight();
196 newtof = (*iHit).timeOfFlight()+
shiftinfo[simdetid.rawId()];
199 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
201 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
202 prpc->push_back(
hit);
205 int RawId = simdetid.rawId();
206 std::cout<<
"We found a DT simhit the RawId in Dec is";
210 std::cout<<
"once masked in oct "<<std::endl;
211 int compressedRawId = RawId/8/8/8/8/8;
214 int extendedRawId = compressedRawId*8*8*8*8*8;
216 std::cout<<
"converted again in decimal"<<std::endl;
217 std::cout<<dec<<extendedRawId<<std::endl;
221 newtof = (*iHit).timeOfFlight();
223 newtof = (*iHit).timeOfFlight()+
shiftinfo[extendedRawId];
224 std::cout<<
"RawId = "<<extendedRawId<<
"is in the map "<<(*iHit).timeOfFlight()<<
" "<<newtof<<std::endl;
227 std::cout<<
"\t\t We have an DT Sim Hit! in t="<<(*iHit).timeOfFlight()<<
" DetId="<<(*iHit).detUnitId()<<std::endl;
228 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
230 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
240 std::cout<<
"The RawId is not in the map,perhaps it is on the CSCs station 1 ring 4"<<std::endl;
241 if(TheChamberDetId.
station()==1 && TheChamberDetId.
ring()==4){
246 std::cout<<
"CSC Warning the RawId = "<<TheChamberDetIdNoring4<<
" "<<TheChamberDetIdNoring4.
rawId()<<
"is not in the map"<<std::endl;
247 newtof = (*iHit).timeOfFlight();
249 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetIdNoring4.
rawId()];
253 newtof = (*iHit).timeOfFlight()+
shiftinfo[TheChamberDetId.
rawId()];
256 PSimHit hit((*iHit).entryPoint(),(*iHit).exitPoint(),(*iHit).pabs(),
258 (*iHit).energyLoss(),(*iHit).particleType(),simdetid,(*iHit). trackId(),(*iHit).thetaAtEntry(),(*iHit).phiAtEntry(),(*iHit).processType());
260 std::cout<<
"CSC check newtof"<<newtof<<
" "<<(*iHit).timeOfFlight()<<std::endl;
261 if(newtof==(*iHit).timeOfFlight())
std::cout<<
"Warning!!!"<<std::endl;
262 pcsc->push_back(
hit);
266 std::cout<<
"Putting collections in the event"<<std::endl;
268 iEvent.
put(pcsc,
"MuonCSCHits");
269 iEvent.
put(pdt,
"MuonDTHits");
270 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 beginRun(const edm::Run &, const edm::EventSetup &)
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
unsigned int offset(bool)
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< PSimHit > PSimHitContainer
std::string ShiftFileName