9 #include "CLHEP/Units/PhysicalConstants.h" 10 using namespace CLHEP;
21 for(map<string, string>::iterator it = simcons.begin(); it != simcons.end(); it++)
22 *txtout <<
" > " << it->first <<
" " << it->second << endl;
36 *txtout <<
" --- Header Bank -- " << endl;
39 for(map<string, double> :: iterator it = data.begin(); it != data.end(); it++)
41 int bankId = bank.
getVarId(it->first);
44 *txtout <<
" - (" <<
HEADER_BANK_TAG <<
", " << bankId <<
") " << it->first <<
":\t" << it->second << endl;
46 *txtout <<
" --- End of Header Bank -- " << endl;
58 *txtout <<
" --- Generated Particles Bank -- " << endl;
60 for(
unsigned int i=0; i<MAXP && i<MGP.size(); i++)
62 *txtout <<
" - Particle " << i+1 <<
" pid: "<< MGP[i].PID
63 <<
" - mom: " << MGP[i].momentum/MeV
64 <<
" MeV - vert: " << MGP[i].vertex/mm <<
" mm" << endl;
66 for(
unsigned d=0; d<MGP[i].pSum.size(); d++)
68 *txtout <<
" - Hit >" << MGP[i].pSum[d].dname
69 <<
"< Has " << MGP[i].pSum[d].stat <<
" hit";
70 if(MGP[i].pSum[d].stat>1) *txtout <<
"s";
72 if(MGP[i].pSum[d].etot > 0)
74 *txtout <<
" with etot " << MGP[i].pSum[d].etot/MeV
75 <<
" MeV and time " << MGP[i].pSum[d].t <<
" ns" << endl;
77 else if(MGP[i].pSum[d].nphe > 0)
79 *txtout <<
" with nphe " << MGP[i].pSum[d].nphe
80 <<
" nphe and time " << MGP[i].pSum[d].t <<
" ns" << endl;
84 *txtout <<
" --- End of Generated Particles Bank -- " << endl;
89 if(!insideBank[thisHitBank.
bankName])
93 insideBank[thisHitBank.
bankName] = 1;
104 initBank(output, thisHitBank);
107 *txtout <<
" -- integrated true infos bank (" << thisHitBank.
idtag +
RAWINT_ID <<
", 0) -- " << endl;
110 int bankId = rawBank.
getVarId(it->second);
114 map<string, double> raws = HO[0].getRaws();
117 if(raws.find(it->second) != raws.end() && bankId >= 0 && bankType ==
RAWINT_ID)
119 *txtout <<
" - (" << rawBank.
idtag + thisHitBank.
idtag <<
", " << bankId <<
") " << it->second <<
":\t" ;
120 for(
unsigned int nh=0; nh<HO.size(); nh++)
122 map<string, double> theseRaws = HO[nh].getRaws();
123 *txtout << theseRaws[it->second] <<
"\t" ;
128 *txtout <<
" -- end of integrated raw bank." << endl;
141 initBank(output, thisHitBank);
144 *txtout <<
" -- step by step true infos bank (" << thisHitBank.
idtag +
RAWSTEP_ID <<
", 0) -- " << endl;
147 int bankId = allRawsBank.
getVarId(it->second);
151 map<string, vector<double> > allRaws = HO[0].getAllRaws();
154 if(allRaws.find(it->second) != allRaws.end() && bankId >= 0 && bankType ==
RAWSTEP_ID)
156 *txtout <<
" - (" << allRawsBank.
idtag + thisHitBank.
idtag <<
", " << bankId <<
") " << it->second <<
":\t" ;
157 for(
unsigned int nh=0; nh<HO.size(); nh++)
159 map<string, vector<double> > theseRaws = HO[nh].getAllRaws();
161 vector<double> theseRawsSteps = theseRaws[it->second];
163 for(
unsigned s=0; s<theseRawsSteps.size(); s++)
164 *txtout << theseRawsSteps[s] <<
"\t" ;
169 *txtout <<
" -- end of integrated raw bank." << endl;
182 initBank(output, thisHitBank);
185 *txtout <<
" -- integrated digitized bank (" << thisHitBank.
idtag +
DGTINT_ID <<
", 0) -- " << endl;
189 int bankId = dgtBank.
getVarId(it->second);
193 map<string, double> dgts = HO[0].getDgtz();
196 if(dgts.find(it->second) != dgts.end() && bankId > 0 && bankType ==
DGTINT_ID)
198 *txtout <<
" - (" << dgtBank.
idtag + thisHitBank.
idtag <<
", " << bankId <<
") " << it->second <<
":\t";
200 for(
unsigned int nh=0; nh<HO.size(); nh++)
202 map<string, double> theseDgts = HO[nh].getDgtz();
203 *txtout << theseDgts[it->second] <<
"\t" ;
209 *txtout <<
" -- End of integrated digitized bank." << endl;
214 if(insideBank.size())
217 *txtout <<
" ---- End of Event ---- " << endl;
void writeEvent(outputContainer *)
void writeGenerated(outputContainer *, vector< generatedParticle >, map< string, gBank > *banksMap)
void recordSimConditions(outputContainer *, map< string, string >)
gBank getDgtBankFromMap(string name, map< string, gBank > *banksMap)
int idtag
unique id for the bank
int getVarBankType(string)
void initBank(outputContainer *, gBank)
gBank getBankFromMap(string name, map< string, gBank > *banksMap)
map< string, aopt > optMap
Options map.
string bankName
name of the bank, it's also key in the map but we store it here as well
map< int, string > orderedNames
virtual void writeG4RawAll(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)
void writeG4DgtIntegrated(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)
#define SIMULATION_CONDITIONS_BANK_TAG
void writeG4RawIntegrated(outputContainer *, vector< hitOutput >, string, map< string, gBank > *)
void writeHeader(outputContainer *, map< string, double >, gBank)