11 #include <cdc/modules/cdcJobCntlParModifier/CDCJobCntlParModifierModule.h>
21 m_gcp(
CDCGeoControlPar::getInstance()), m_timeWalk(), m_wireSag(), m_modLeftRightFlag(), m_debug4Sim(), m_thresholdEnergyDeposit(),
22 m_minTrackLength(), m_maxSpaceResol(), m_addFudgeFactorForSigmaForData(), m_addFudgeFactorForSigmaForMC(),
23 m_mapperGeometry(), m_mapperPhiAngle(), m_debug4Geo(), m_printMaterialTable(),
24 m_materialDefinitionMode(), m_senseWireZposMode(),
28 m_displacementInputType(), m_alignmentInputType(), m_misalignmentInputType(), m_xtInputType(), m_sigmaInputType(),
29 m_propSpeedInputType(), m_t0InputType(), m_twInputType(), m_bwInputType(), m_chMapInputType(), m_eDepToADCInputType(),
31 m_alignmentFile(), m_misalignmentFile(), m_xtFile(), m_sigmaFile(), m_propSpeedFile(), m_t0File(), m_twFile(), m_bwFile(),
32 m_chMapFile(), m_eDepToADCFile()
37 setDescription(
"Change job contorol parameters. Please put this module in the path (before Geometry module) with specified input parameters when you want to change them.");
38 setPropertyFlags(c_ParallelProcessingCertified);
43 addParam(
"Debug4Sim", m_debug4Sim,
"Switch on/off debug in FullSim.",
false);
45 addParam(
"TimeWalkInTranslator", m_timeWalk,
46 "Switch on/off time-walk correction in the TDC-count translator for MC events. Use the CDCDigitizer's flag if you want to add/not add time walk in digitization.",
49 addParam(
"WireSag", m_wireSag,
50 "Switch on/off sense wire (gravitational) sag in FullSim. Here, sag means the main part which corresponds to design+displacement in case of wire position. You can control the perturbative part (corresponting to (mis)alignment in case of wire-position) of sag in Digitizer.",
53 addParam(
"ModLeftRightFlag", m_modLeftRightFlag,
"Switch on/off calculation of modified left/right flag in FullSim.",
false);
55 addParam(
"ThresholdEnergyDeposit", m_thresholdEnergyDeposit,
56 "Energy deposite (edep) thresh. for G4 step (GeV). All hits with smaller edep will be dropped at FullSim level. Set this to a negative value if you want to keep simhits with edep=0.",
59 addParam(
"MinTrackLength", m_minTrackLength,
60 "Minimum track length (cm) required for saving in MCParticle.; to be applied to all particles other than primaries and decay-daughters.",
65 addParam(
"Debug4Geo", m_debug4Geo,
"Switch on/off debug in Geo.",
false);
67 addParam(
"PrintMaterialTable", m_printMaterialTable,
68 "Switch on/off printing the G4 material table at the stage of CDC geometry creation.",
false);
70 addParam(
"MaterialDefinitionMode", m_materialDefinitionMode,
71 "Material definition mode: =0: define a mixture of gases and wires in the entire tracking volume; =1: dummy; =2: define all sense and field wires explicitly in the volume.",
74 addParam(
"SenseWireZposMode", m_senseWireZposMode,
75 "Sense wire z position mode: =1: correct for feedthrough effect; =0: not correct.", 1);
77 addParam(
"Displacement", m_displacement,
"Switch for wire displacement: on/off.",
true);
79 addParam(
"Alignment", m_alignment,
"Switch for wire alignment: on/off.",
true);
82 m_misalignment =
false;
86 addParam(
"DisplacementInputType", m_displacementInputType,
"Input type for wire displacement; db-object (true); text-file (false).",
89 addParam(
"AlignmentInputType", m_alignmentInputType,
"Input type for wire alignment; db-object (true); text-file (false).",
true);
92 m_misalignmentInputType =
true;
94 addParam(
"XtInputType", m_xtInputType,
"Input type for xt-relations; db-object (true); text-file (false).",
true);
96 addParam(
"SigmaInputType", m_sigmaInputType,
"Input type for sigmas; db-object (true); text-file (false).",
true);
98 addParam(
"PropSpeedInputType", m_propSpeedInputType,
"Input type for prop-speeds; db-object (true); text-file (false).",
true);
100 addParam(
"T0InputType", m_t0InputType,
"Input type for t0s; db-object (true); text-file (false).",
true);
102 addParam(
"TimeWalkInputType", m_twInputType,
"Input type for time walks; db-object (true); text-file (false).",
true);
104 addParam(
"BadWireInputType", m_bwInputType,
"Input type for bad wires; db-object (true); text-file (false).",
true);
106 addParam(
"ChannelMapInputType", m_chMapInputType,
"Input type for channel map; db-object (true); text-file (false).",
true);
108 addParam(
"EDepToADCInputType", m_eDepToADCInputType,
"Input type for edep-to-adc; db-object (true); text-file (false).",
true);
112 addParam(
"DisplacementFile", m_displacementFile,
"Input file name (on cdc/data) for wire displacement.",
113 string(
"displacement_v2.2.1.dat"));
115 addParam(
"AlignmentFile", m_alignmentFile,
"Input file name (on cdc/data) for wire alignment.",
string(
"alignment_v2.dat"));
118 m_misalignmentFile = string(
"misalignment_v2.dat");
120 addParam(
"XtFile", m_xtFile,
"Input file name (on cdc/data) for xt-relations. You can specify either an uncompressed or gzip file.",
121 string(
"xt_v3_chebyshev.dat.gz"));
123 addParam(
"SigmaFile", m_sigmaFile,
"Input file name (on cdc/data) for sigmas.",
string(
"sigma_v2.dat"));
125 addParam(
"PropSpeedFile", m_propSpeedFile,
"Input file name (on cdc/data) for prop-speeds.",
string(
"propspeed_v0.dat"));
127 addParam(
"T0File", m_t0File,
"Input file name (on cdc/data) for t0s.",
string(
"t0_v1.dat"));
129 addParam(
"TimeWalkFile", m_twFile,
"Input file name (on cdc/data) for time walks.",
string(
"tw_off.dat"));
131 addParam(
"BadWireFile", m_bwFile,
"Input file name (on cdc/data) for bad wires.",
string(
"badwire_v1.dat"));
133 addParam(
"ChannelMapFile", m_chMapFile,
"Input file name (on cdc/data) for channel map.",
string(
"ch_map.dat"));
135 addParam(
"EDepToADCFile", m_eDepToADCFile,
"Input file name (on cdc/data) for edep-to-adc.",
string(
"edeptoadc.dat"));
138 addParam(
"MaxSpaceResol", m_maxSpaceResol,
139 "Maximum space resolution (cm) in CDCGeometryPar::getSigma() to avoid a too large value; from 2011 beam test; a bit larger value may be better...",
140 double(2.5 * 0.0130));
143 addParam(
"AddFudgeFactorForSigmaForData", m_addFudgeFactorForSigmaForData,
144 "Additional fudge factor for space resol. used in real data event reconstruction (common to all cells).",
148 addParam(
"AddFudgeFactorForSigmaForMC", m_addFudgeFactorForSigmaForMC,
149 "Additional fudge factor for space resol. used in MC event reconstruction (common to all cells). N.B. This factor is not applied in digitization; only applied in reconstruction. Pplease set the fudge parameter of digitizer instead if you want to change the digitization sigma indep. of sigma used in reconstruction.",
153 addParam(
"MapperGeometry", m_mapperGeometry,
"Define B-field mapper geometry used in GCR in 2017 summer. Tentative option.",
157 addParam(
"MapperPhiAngle", m_mapperPhiAngle,
"Phi-angle (deg.) of B-field mapper used in GCR in 2017 summer. Tentative option.",
162 void CDCJobCntlParModifierModule::initialize()
166 if (m_scp.getTimeWalk() != m_timeWalk) {
167 B2INFO(
"CDCJobCntlParModifier: timeWalk modified: " << m_scp.getTimeWalk() <<
" to " << m_timeWalk);
168 m_scp.setTimeWalk(m_timeWalk);
171 if (m_scp.getWireSag() != m_wireSag) {
172 B2INFO(
"CDCJobCntlParModifier: wireSag modified: " << m_scp.getWireSag() <<
" to " << m_wireSag);
173 m_scp.setWireSag(m_wireSag);
176 if (m_scp.getModLeftRightFlag() != m_modLeftRightFlag) {
177 B2INFO(
"CDCJobCntlParModifier: modLeftRightFlag modified: " << m_scp.getModLeftRightFlag() <<
" to " << m_modLeftRightFlag);
178 m_scp.setModLeftRightFlag(m_modLeftRightFlag);
181 if (m_scp.getDebug() != m_debug4Sim) {
182 B2INFO(
"CDCJobCntlParModifier: debug4Sim modified: " << m_scp.getDebug() <<
" to " << m_debug4Sim);
183 m_scp.setDebug(m_debug4Sim);
186 if (m_scp.getThresholdEnergyDeposit() != m_thresholdEnergyDeposit) {
187 B2INFO(
"CDCJobCntlParModifier: thresholdEnergyDeposit modified: " << m_scp.getThresholdEnergyDeposit() <<
" to " <<
188 m_thresholdEnergyDeposit);
189 m_scp.setThresholdEnergyDeposit(m_thresholdEnergyDeposit);
192 if (m_scp.getMinTrackLength() != m_minTrackLength) {
193 B2INFO(
"CDCJobCntlParModifier: minTrackLength modified: " << m_scp.getMinTrackLength() <<
" to " << m_minTrackLength);
194 m_scp.setMinTrackLength(m_minTrackLength);
198 if (m_gcp.getMaterialDefinitionMode() != m_materialDefinitionMode) {
199 B2INFO(
"CDCJobCntlParModifier: materialDefinitionMode modified: " << m_gcp.getMaterialDefinitionMode() <<
" to " <<
200 m_materialDefinitionMode);
201 m_gcp.setMaterialDefinitionMode(m_materialDefinitionMode);
204 if (m_gcp.getSenseWireZposMode() != m_senseWireZposMode) {
205 B2INFO(
"CDCJobCntlParModifier: senseWireZposMode modified: " << m_gcp.getSenseWireZposMode() <<
" " << m_senseWireZposMode);
206 m_gcp.setSenseWireZposMode(m_senseWireZposMode);
209 if (m_gcp.getPrintMaterialTable() != m_printMaterialTable) {
210 B2INFO(
"CDCJobCntlParModifier: printMaterialTable modified: " << m_gcp.getPrintMaterialTable() <<
" to " << m_printMaterialTable);
211 m_gcp.setPrintMaterialTable(m_printMaterialTable);
214 if (m_gcp.getDebug() != m_debug4Geo) {
215 B2INFO(
"CDCJobCntlParModifier: debug4Geo modified: " << m_gcp.getDebug() <<
" to " << m_debug4Geo);
216 m_gcp.setDebug(m_debug4Geo);
219 if (m_gcp.getDisplacement() != m_displacement) {
220 B2INFO(
"CDCJobCntlParModifier: displacement switch modified: " << m_gcp.getDisplacement() <<
" to " << m_displacement);
221 m_gcp.setDisplacement(m_displacement);
224 if (m_gcp.getAlignment() != m_alignment) {
225 B2INFO(
"CDCJobCntlParModifier: alignment switch modified: " << m_gcp.getAlignment() <<
" to " << m_alignment);
226 m_gcp.setAlignment(m_alignment);
229 if (m_gcp.getMisalignment() != m_misalignment) {
230 B2INFO(
"CDCJobCntlParModifier: misalignment switch modified: " << m_gcp.getMisalignment() <<
" to " << m_misalignment);
231 m_gcp.setMisalignment(m_misalignment);
234 if (m_gcp.getDisplacementInputType() != m_displacementInputType) {
235 B2INFO(
"CDCJobCntlParModifier: displacementInputType modified: " << m_gcp.getDisplacementInputType() <<
" to " <<
236 m_displacementInputType);
237 m_gcp.setDisplacementInputType(m_displacementInputType);
240 if (m_gcp.getAlignmentInputType() != m_alignmentInputType) {
241 B2INFO(
"CDCJobCntlParModifier: alignmentInputType modified: " << m_gcp.getAlignmentInputType() <<
" to " << m_alignmentInputType);
242 m_gcp.setAlignmentInputType(m_alignmentInputType);
245 if (m_gcp.getMisalignmentInputType() != m_misalignmentInputType) {
246 B2INFO(
"CDCJobCntlParModifier: misalignmentInputType modified: " << m_gcp.getMisalignmentInputType() <<
" to " <<
247 m_misalignmentInputType);
248 m_gcp.setMisalignmentInputType(m_misalignmentInputType);
251 if (m_gcp.getXtInputType() != m_xtInputType) {
252 B2INFO(
"CDCJobCntlParModifier: xtInputType modified: " << m_gcp.getXtInputType() <<
" to " << m_xtInputType);
253 m_gcp.setXtInputType(m_xtInputType);
256 if (m_gcp.getSigmaInputType() != m_sigmaInputType) {
257 B2INFO(
"CDCJobCntlParModifier: sigmaInputType modified: " << m_gcp.getSigmaInputType() <<
" to " << m_sigmaInputType);
258 m_gcp.setSigmaInputType(m_sigmaInputType);
261 if (m_gcp.getPropSpeedInputType() != m_propSpeedInputType) {
262 B2INFO(
"CDCJobCntlParModifier: propSpeedInputType modified: " << m_gcp.getPropSpeedInputType() <<
" to " << m_propSpeedInputType);
263 m_gcp.setPropSpeedInputType(m_propSpeedInputType);
266 if (m_gcp.getT0InputType() != m_t0InputType) {
267 B2INFO(
"CDCJobCntlParModifier: t0InputType modified: " << m_gcp.getT0InputType() <<
" to " << m_t0InputType);
268 m_gcp.setT0InputType(m_t0InputType);
271 if (m_gcp.getTwInputType() != m_twInputType) {
272 B2INFO(
"CDCJobCntlParModifier: twInputType modified: " << m_gcp.getTwInputType() <<
" to " << m_twInputType);
273 m_gcp.setTwInputType(m_twInputType);
276 if (m_gcp.getBwInputType() != m_bwInputType) {
277 B2INFO(
"CDCJobCntlParModifier: bwInputType modified: " << m_gcp.getBwInputType() <<
" to " << m_bwInputType);
278 m_gcp.setBwInputType(m_bwInputType);
281 if (m_gcp.getChMapInputType() != m_chMapInputType) {
282 B2INFO(
"CDCJobCntlParModifier: chMapInputType modified: " << m_gcp.getChMapInputType() <<
" to " << m_chMapInputType);
283 m_gcp.setChMapInputType(m_chMapInputType);
286 if (m_gcp.getEDepToADCInputType() != m_eDepToADCInputType) {
287 B2INFO(
"CDCJobCntlParModifier: edep-to-adc modified: " << m_gcp.getEDepToADCInputType() <<
" to " << m_eDepToADCInputType);
288 m_gcp.setEDepToADCInputType(m_eDepToADCInputType);
291 if (m_gcp.getDisplacementFile() != m_displacementFile) {
292 B2INFO(
"CDCJobCntlParModifier: displacementFile modified: " << m_gcp.getDisplacementFile() <<
" to " << m_displacementFile);
293 m_gcp.setDisplacementFile(m_displacementFile);
296 if (m_gcp.getAlignmentFile() != m_alignmentFile) {
297 B2INFO(
"CDCJobCntlParModifier: alignmentFile modified: " << m_gcp.getAlignmentFile() <<
" to " << m_alignmentFile);
298 m_gcp.setAlignmentFile(m_alignmentFile);
301 if (m_gcp.getMisalignmentFile() != m_misalignmentFile) {
302 B2INFO(
"CDCJobCntlParModifier: misalignmentFile modified: " << m_gcp.getMisalignmentFile() <<
" to " << m_misalignmentFile);
303 m_gcp.setMisalignmentFile(m_misalignmentFile);
306 if (m_gcp.getXtFile() != m_xtFile) {
307 B2INFO(
"CDCJobCntlParModifier: xtFile modified: " << m_gcp.getXtFile() <<
" to " << m_xtFile);
308 m_gcp.setXtFile(m_xtFile);
311 if (m_gcp.getSigmaFile() != m_sigmaFile) {
312 B2INFO(
"CDCJobCntlParModifier: sigmaFile modified: " << m_gcp.getSigmaFile() <<
" to " << m_sigmaFile);
313 m_gcp.setSigmaFile(m_sigmaFile);
316 if (m_gcp.getPropSpeedFile() != m_propSpeedFile) {
317 B2INFO(
"CDCJobCntlParModifier: propSpeedFile modified: " << m_gcp.getPropSpeedFile() <<
" to " << m_propSpeedFile);
318 m_gcp.setPropSpeedFile(m_propSpeedFile);
321 if (m_gcp.getT0File() != m_t0File) {
322 B2INFO(
"CDCJobCntlParModifier: t0File modified: " << m_gcp.getT0File() <<
" to " << m_t0File);
323 m_gcp.setT0File(m_t0File);
326 if (m_gcp.getTwFile() != m_twFile) {
327 B2INFO(
"CDCJobCntlParModifier: timeWalkFile modified: " << m_gcp.getTwFile() <<
" to " << m_twFile);
328 m_gcp.setTwFile(m_twFile);
331 if (m_gcp.getBwFile() != m_bwFile) {
332 B2INFO(
"CDCJobCntlParModifier: badWireFile modified: " << m_gcp.getBwFile() <<
" to " << m_bwFile);
333 m_gcp.setBwFile(m_bwFile);
336 if (m_gcp.getChMapFile() != m_chMapFile) {
337 B2INFO(
"CDCJobCntlParModifier: chMapFile modified: " << m_gcp.getChMapFile() <<
" to " << m_chMapFile);
338 m_gcp.setChMapFile(m_chMapFile);
341 if (m_gcp.getEDepToADCFile() != m_eDepToADCFile) {
342 B2INFO(
"CDCJobCntlParModifier: edep-to-adcFile modified: " << m_gcp.getEDepToADCFile() <<
" to " << m_eDepToADCFile);
343 m_gcp.setEDepToADCFile(m_eDepToADCFile);
346 if (m_gcp.getMaxSpaceResolution() != m_maxSpaceResol) {
347 B2INFO(
"CDCJobCntlParModifier: maxSpaceResol modified: " << m_gcp.getMaxSpaceResolution() <<
" to " << m_maxSpaceResol);
348 m_gcp.setMaxSpaceResolution(m_maxSpaceResol);
351 if (m_gcp.getAddFudgeFactorForSigmaForData() != m_addFudgeFactorForSigmaForData) {
352 B2INFO(
"CDCJobCntlParModifier: addFudgeFactorForSigmaForData modified: " << m_gcp.getAddFudgeFactorForSigmaForData() <<
" to "
353 << m_addFudgeFactorForSigmaForData);
354 m_gcp.setAddFudgeFactorForSigmaForData(m_addFudgeFactorForSigmaForData);
357 if (m_gcp.getAddFudgeFactorForSigmaForMC() != m_addFudgeFactorForSigmaForMC) {
358 B2INFO(
"CDCJobCntlParModifier: addFudgeFactorForSigmaForMC modified: " << m_gcp.getAddFudgeFactorForSigmaForMC() <<
" to " <<
359 m_addFudgeFactorForSigmaForMC);
360 m_gcp.setAddFudgeFactorForSigmaForMC(m_addFudgeFactorForSigmaForMC);
363 if (m_gcp.getMapperGeometry() != m_mapperGeometry) {
364 B2INFO(
"CDCJobCntlParModifier: mapper geometry flag modified: " << m_gcp.getMapperGeometry() <<
" to " << m_mapperGeometry);
365 m_gcp.setMapperGeometry(m_mapperGeometry);
368 if (m_gcp.getMapperPhiAngle() != m_mapperPhiAngle) {
369 B2INFO(
"CDCJobCntlParModifier: mapper phi-angle modified: " << m_gcp.getMapperPhiAngle() <<
" to " << m_mapperPhiAngle);
370 m_gcp.setMapperPhiAngle(m_mapperPhiAngle);
374 void CDCJobCntlParModifierModule::event()