44 #include "CLHEP/Random/RandomEngine.h" 47 #include "G4SDManager.hh" 50 #include "G4VProcess.hh" 51 #include "G4HCofThisEvent.hh" 52 #include "G4UserEventAction.hh" 53 #include "G4TransportationManager.hh" 54 #include "G4ProcessManager.hh" 69 produces<DigiCollectionFP420>().setBranchAlias( alias );
95 std::cout <<
"Creating a DigitizerFP420" << std::endl;
96 std::cout <<
"DigitizerFP420: dn0=" << dn0 <<
" sn0=" << sn0 <<
" pn0=" << pn0 <<
" rn0=" << rn0 << std::endl;
104 std::cout <<
"Destroying a DigitizerFP420" << std::endl;
116 std::cout <<
" ============== DigitizerFP420: start produce= " << std::endl;
127 std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
130 cf_simhitvec.push_back(cf_simhit.
product()); }
159 std::cout <<
" ============== DigitizerFP420: MixCollection treatment= " << std::endl;
164 for (isim=allTrackerHits->begin(); isim!= allTrackerHits->end();isim++) {
165 unsigned int unitID = (*isim).detUnitId();
166 int det,
zside, sector, zmodule;
175 double losenergy = (*isim).energyLoss();
177 std::cout <<
" ============== DigitizerFP420: losenergy= " << losenergy << std::endl;
178 std::cout <<
" === for intindex = " << intindex << std::endl;
189 std::cout <<
" ============== DigitizerFP420: put zero to container " << std::endl;
194 for (
int det=1; det<
dn0; det++) {
195 for (
int sector=1; sector<
sn0; sector++) {
196 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
205 inputRange.first = collector.begin();
206 inputRange.second = collector.end();
207 output->putclear(inputRange,detID);
221 std::cout <<
" ============== DigitizerFP420: start loop over det iu " << std::endl;
222 std::cout <<
" ============== DigitizerFP420: SimHitMap.size()= " <<
SimHitMap.size() << std::endl;
249 vector<PSimHit>::const_iterator simHitIter =
SimHitMap[
i].begin();
250 vector<PSimHit>::const_iterator simHitIterEnd =
SimHitMap[
i].end();
251 for (;simHitIter != simHitIterEnd; ++simHitIter) {
252 const PSimHit ihit = *simHitIter;
255 int det,
zside, sector, zmodule;
259 if(
verbosity>0 ||
verbosity==-50)
std::cout <<
"for Hits iu = " << iu <<
" sector = " << sector <<
" zmodule = " << zmodule <<
" zside = " << zside <<
" det=" << det << std::endl;
265 std::cout <<
" DigitizerFP420: index = " << index <<
" iu = " << iu << std::endl;
270 G4ThreeVector bfield( 0., 0., 0.0 );
276 std::cout <<
" ============== DigitizerFP420: call run for iu= " << iu << std::endl;
292 std::cout <<
"======= DigitizerFP420: collector size = " <<
collector.size() << std::endl;
307 std::cout <<
" ============= DigitizerFP420:collector start!!!!!!!!!!!!!!" << std::endl;
316 unsigned int detID0= 0;
317 output->put(outputRange,detID0);
321 output->put(outputRange,iu);
358 for (
int det=1; det<
dn0; det++) {
359 for (
int sector=1; sector<
sn0; sector++) {
360 for (
int zmodule=1; zmodule<
pn0; zmodule++) {
365 std::cout <<
"****DigitizerFP420:check2" << std::endl;
368 int newdet, newzside, newsector, newzmodule;
370 std::cout <<
" newdet = " << newdet <<
" newsector = " << newsector <<
" newzmodule = " << newzmodule <<
" newzside = " << newzside << std::endl;
375 outputRange = output->get(iu);
382 for ( ;sort_begin != sort_end; ++sort_begin ) {
383 collector.push_back(*sort_begin);
387 std::cout <<
"====== collector size = " << collector.size() << std::endl;
388 if(collector.size()>0) {
389 std::cout <<
" iu = " << iu <<
" sector = " << sector <<
" zmodule = " << zmodule <<
" zside = " <<
zside <<
" det=" << det <<
" layer = " << layer <<
" orient = " << orient << std::endl;
392 vector<HDigiFP420>::const_iterator simHitIter = collector.begin();
393 vector<HDigiFP420>::const_iterator simHitIterEnd = collector.end();
394 for (;simHitIter != simHitIterEnd; ++simHitIter) {
396 std::cout <<
" strip number=" << istrip.
strip() <<
" adc=" << istrip.
adc() << std::endl;
400 std::cout <<
" ===================================================" << std::endl;
416 std::cout <<
"DigitizerFP420 recoutput" << std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
FP420DigiMain * stripDigitizer_
std::vector< HDigiFP420 >::const_iterator ContainerIterator
static void unpackFP420Index(const unsigned int &idx, int &det, int &zside, int &station, int &superplane)
static int unpackLayerIndex(int rn0, int zside)
std::vector< HDigiFP420 > collector
static void unpackMYIndex(const int &idx, int rn0, int pn0, int sn0, int &det, int &zside, int §or, int &zmodule)
std::vector< HDigiFP420 > run(const std::vector< PSimHit > &input, const G4ThreeVector &, unsigned int)
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
static unsigned int packFP420Index(int det, int zside, int station, int superplane)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::pair< ContainerIterator, ContainerIterator > Range
T const * product() const
inputRange
Get input source.
virtual void produce(edm::Event &e, const edm::EventSetup &c)
static int unpackOrientation(int rn0, int zside)
virtual ~DigitizerFP420()
vstring trackerContainers
unsigned int detUnitId() const