9 #include <cdc/modules/cdcJobCntlParModifier/CDCJobCntlParModifierModule.h>
19 m_gcp(
CDCGeoControlPar::getInstance()), m_timeWalk(), m_wireSag(), m_modLeftRightFlag(), m_debug4Sim(), m_thresholdEnergyDeposit(),
20 m_minTrackLength(), m_addFudgeFactorForSigmaForData(), m_addFudgeFactorForSigmaForMC(),
21 m_mapperGeometry(), m_mapperPhiAngle(), m_debug4Geo(), m_printMaterialTable(),
22 m_materialDefinitionMode(), m_senseWireZposMode(),
26 m_displacementInputType(), m_alignmentInputType(), m_misalignmentInputType(), m_xtInputType(), m_sigmaInputType(),
27 m_propSpeedInputType(), m_t0InputType(), m_twInputType(), m_bwInputType(), m_chMapInputType(), m_eDepToADCInputType(),
29 m_alignmentFile(), m_misalignmentFile(), m_xtFile(), m_sigmaFile(), m_propSpeedFile(), m_t0File(), m_twFile(), m_bwFile(),
30 m_chMapFile(), m_eDepToADCFile()
35 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.");
36 setPropertyFlags(c_ParallelProcessingCertified);
41 addParam(
"Debug4Sim", m_debug4Sim,
"Switch on/off debug in FullSim.",
false);
43 addParam(
"TimeWalkInTranslator", m_timeWalk,
44 "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.",
47 addParam(
"WireSag", m_wireSag,
48 "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.",
51 addParam(
"ModLeftRightFlag", m_modLeftRightFlag,
"Switch on/off calculation of modified left/right flag in FullSim.",
false);
53 addParam(
"ThresholdEnergyDeposit", m_thresholdEnergyDeposit,
54 "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.",
57 addParam(
"MinTrackLength", m_minTrackLength,
58 "Minimum track length (cm) required for saving in MCParticle.; to be applied to all particles other than primaries and decay-daughters.",
63 addParam(
"Debug4Geo", m_debug4Geo,
"Switch on/off debug in Geo.",
false);
65 addParam(
"PrintMaterialTable", m_printMaterialTable,
66 "Switch on/off printing the G4 material table at the stage of CDC geometry creation.",
false);
68 addParam(
"MaterialDefinitionMode", m_materialDefinitionMode,
69 "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.",
72 addParam(
"SenseWireZposMode", m_senseWireZposMode,
73 "Sense wire z position mode: =1: correct for feedthrough effect; =0: not correct.", 1);
75 addParam(
"Displacement", m_displacement,
"Switch for wire displacement: on/off.",
true);
77 addParam(
"Alignment", m_alignment,
"Switch for wire alignment: on/off.",
true);
80 m_misalignment =
false;
84 addParam(
"DisplacementInputType", m_displacementInputType,
"Input type for wire displacement; db-object (true); text-file (false).",
87 addParam(
"AlignmentInputType", m_alignmentInputType,
"Input type for wire alignment; db-object (true); text-file (false).",
true);
90 m_misalignmentInputType =
true;
92 addParam(
"XtInputType", m_xtInputType,
"Input type for xt-relations; db-object (true); text-file (false).",
true);
94 addParam(
"SigmaInputType", m_sigmaInputType,
"Input type for sigmas; db-object (true); text-file (false).",
true);
96 addParam(
"PropSpeedInputType", m_propSpeedInputType,
"Input type for prop-speeds; db-object (true); text-file (false).",
true);
98 addParam(
"T0InputType", m_t0InputType,
"Input type for t0s; db-object (true); text-file (false).",
true);
100 addParam(
"TimeWalkInputType", m_twInputType,
"Input type for time walks; db-object (true); text-file (false).",
true);
102 addParam(
"BadWireInputType", m_bwInputType,
"Input type for bad wires; db-object (true); text-file (false).",
true);
104 addParam(
"ChannelMapInputType", m_chMapInputType,
"Input type for channel map; db-object (true); text-file (false).",
true);
106 addParam(
"EDepToADCInputType", m_eDepToADCInputType,
"Input type for edep-to-adc; db-object (true); text-file (false).",
true);
110 addParam(
"DisplacementFile", m_displacementFile,
"Input file name (on cdc/data) for wire displacement.",
111 string(
"displacement_v2.2.1.dat"));
113 addParam(
"AlignmentFile", m_alignmentFile,
"Input file name (on cdc/data) for wire alignment.",
string(
"alignment_v2.dat"));
116 m_misalignmentFile = string(
"misalignment_v2.dat");
118 addParam(
"XtFile", m_xtFile,
"Input file name (on cdc/data) for xt-relations. You can specify either an uncompressed or gzip file.",
119 string(
"xt_v3_chebyshev.dat.gz"));
121 addParam(
"SigmaFile", m_sigmaFile,
"Input file name (on cdc/data) for sigmas.",
string(
"sigma_v2.dat"));
123 addParam(
"PropSpeedFile", m_propSpeedFile,
"Input file name (on cdc/data) for prop-speeds.",
string(
"propspeed_v0.dat"));
125 addParam(
"T0File", m_t0File,
"Input file name (on cdc/data) for t0s.",
string(
"t0_v1.dat"));
127 addParam(
"TimeWalkFile", m_twFile,
"Input file name (on cdc/data) for time walks.",
string(
"tw_off.dat"));
129 addParam(
"BadWireFile", m_bwFile,
"Input file name (on cdc/data) for bad wires.",
string(
"badwire_v1.dat"));
131 addParam(
"ChannelMapFile", m_chMapFile,
"Input file name (on cdc/data) for channel map.",
string(
"ch_map.dat"));
133 addParam(
"EDepToADCFile", m_eDepToADCFile,
"Input file name (on cdc/data) for edep-to-adc.",
string(
"edeptoadc.dat"));
136 addParam(
"AddFudgeFactorForSigmaForData", m_addFudgeFactorForSigmaForData,
137 "Additional fudge factor for space resol. used in real data event reconstruction (common to all cells).",
141 addParam(
"AddFudgeFactorForSigmaForMC", m_addFudgeFactorForSigmaForMC,
142 "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.",
146 addParam(
"MapperGeometry", m_mapperGeometry,
"Define B-field mapper geometry used in GCR in 2017 summer. Tentative option.",
150 addParam(
"MapperPhiAngle", m_mapperPhiAngle,
"Phi-angle (deg.) of B-field mapper used in GCR in 2017 summer. Tentative option.",
155 void CDCJobCntlParModifierModule::initialize()
159 if (m_scp.getTimeWalk() != m_timeWalk) {
160 B2INFO(
"CDCJobCntlParModifier: timeWalk modified: " << m_scp.getTimeWalk() <<
" to " << m_timeWalk);
161 m_scp.setTimeWalk(m_timeWalk);
164 if (m_scp.getWireSag() != m_wireSag) {
165 B2INFO(
"CDCJobCntlParModifier: wireSag modified: " << m_scp.getWireSag() <<
" to " << m_wireSag);
166 m_scp.setWireSag(m_wireSag);
169 if (m_scp.getModLeftRightFlag() != m_modLeftRightFlag) {
170 B2INFO(
"CDCJobCntlParModifier: modLeftRightFlag modified: " << m_scp.getModLeftRightFlag() <<
" to " << m_modLeftRightFlag);
171 m_scp.setModLeftRightFlag(m_modLeftRightFlag);
174 if (m_scp.getDebug() != m_debug4Sim) {
175 B2INFO(
"CDCJobCntlParModifier: debug4Sim modified: " << m_scp.getDebug() <<
" to " << m_debug4Sim);
176 m_scp.setDebug(m_debug4Sim);
179 if (m_scp.getThresholdEnergyDeposit() != m_thresholdEnergyDeposit) {
180 B2INFO(
"CDCJobCntlParModifier: thresholdEnergyDeposit modified: " << m_scp.getThresholdEnergyDeposit() <<
" to " <<
181 m_thresholdEnergyDeposit);
182 m_scp.setThresholdEnergyDeposit(m_thresholdEnergyDeposit);
185 if (m_scp.getMinTrackLength() != m_minTrackLength) {
186 B2INFO(
"CDCJobCntlParModifier: minTrackLength modified: " << m_scp.getMinTrackLength() <<
" to " << m_minTrackLength);
187 m_scp.setMinTrackLength(m_minTrackLength);
191 if (m_gcp.getMaterialDefinitionMode() != m_materialDefinitionMode) {
192 B2INFO(
"CDCJobCntlParModifier: materialDefinitionMode modified: " << m_gcp.getMaterialDefinitionMode() <<
" to " <<
193 m_materialDefinitionMode);
194 m_gcp.setMaterialDefinitionMode(m_materialDefinitionMode);
197 if (m_gcp.getSenseWireZposMode() != m_senseWireZposMode) {
198 B2INFO(
"CDCJobCntlParModifier: senseWireZposMode modified: " << m_gcp.getSenseWireZposMode() <<
" " << m_senseWireZposMode);
199 m_gcp.setSenseWireZposMode(m_senseWireZposMode);
202 if (m_gcp.getPrintMaterialTable() != m_printMaterialTable) {
203 B2INFO(
"CDCJobCntlParModifier: printMaterialTable modified: " << m_gcp.getPrintMaterialTable() <<
" to " << m_printMaterialTable);
204 m_gcp.setPrintMaterialTable(m_printMaterialTable);
207 if (m_gcp.getDebug() != m_debug4Geo) {
208 B2INFO(
"CDCJobCntlParModifier: debug4Geo modified: " << m_gcp.getDebug() <<
" to " << m_debug4Geo);
209 m_gcp.setDebug(m_debug4Geo);
212 if (m_gcp.getDisplacement() != m_displacement) {
213 B2INFO(
"CDCJobCntlParModifier: displacement switch modified: " << m_gcp.getDisplacement() <<
" to " << m_displacement);
214 m_gcp.setDisplacement(m_displacement);
217 if (m_gcp.getAlignment() != m_alignment) {
218 B2INFO(
"CDCJobCntlParModifier: alignment switch modified: " << m_gcp.getAlignment() <<
" to " << m_alignment);
219 m_gcp.setAlignment(m_alignment);
222 if (m_gcp.getMisalignment() != m_misalignment) {
223 B2INFO(
"CDCJobCntlParModifier: misalignment switch modified: " << m_gcp.getMisalignment() <<
" to " << m_misalignment);
224 m_gcp.setMisalignment(m_misalignment);
227 if (m_gcp.getDisplacementInputType() != m_displacementInputType) {
228 B2INFO(
"CDCJobCntlParModifier: displacementInputType modified: " << m_gcp.getDisplacementInputType() <<
" to " <<
229 m_displacementInputType);
230 m_gcp.setDisplacementInputType(m_displacementInputType);
233 if (m_gcp.getAlignmentInputType() != m_alignmentInputType) {
234 B2INFO(
"CDCJobCntlParModifier: alignmentInputType modified: " << m_gcp.getAlignmentInputType() <<
" to " << m_alignmentInputType);
235 m_gcp.setAlignmentInputType(m_alignmentInputType);
238 if (m_gcp.getMisalignmentInputType() != m_misalignmentInputType) {
239 B2INFO(
"CDCJobCntlParModifier: misalignmentInputType modified: " << m_gcp.getMisalignmentInputType() <<
" to " <<
240 m_misalignmentInputType);
241 m_gcp.setMisalignmentInputType(m_misalignmentInputType);
244 if (m_gcp.getXtInputType() != m_xtInputType) {
245 B2INFO(
"CDCJobCntlParModifier: xtInputType modified: " << m_gcp.getXtInputType() <<
" to " << m_xtInputType);
246 m_gcp.setXtInputType(m_xtInputType);
249 if (m_gcp.getSigmaInputType() != m_sigmaInputType) {
250 B2INFO(
"CDCJobCntlParModifier: sigmaInputType modified: " << m_gcp.getSigmaInputType() <<
" to " << m_sigmaInputType);
251 m_gcp.setSigmaInputType(m_sigmaInputType);
254 if (m_gcp.getPropSpeedInputType() != m_propSpeedInputType) {
255 B2INFO(
"CDCJobCntlParModifier: propSpeedInputType modified: " << m_gcp.getPropSpeedInputType() <<
" to " << m_propSpeedInputType);
256 m_gcp.setPropSpeedInputType(m_propSpeedInputType);
259 if (m_gcp.getT0InputType() != m_t0InputType) {
260 B2INFO(
"CDCJobCntlParModifier: t0InputType modified: " << m_gcp.getT0InputType() <<
" to " << m_t0InputType);
261 m_gcp.setT0InputType(m_t0InputType);
264 if (m_gcp.getTwInputType() != m_twInputType) {
265 B2INFO(
"CDCJobCntlParModifier: twInputType modified: " << m_gcp.getTwInputType() <<
" to " << m_twInputType);
266 m_gcp.setTwInputType(m_twInputType);
269 if (m_gcp.getBwInputType() != m_bwInputType) {
270 B2INFO(
"CDCJobCntlParModifier: bwInputType modified: " << m_gcp.getBwInputType() <<
" to " << m_bwInputType);
271 m_gcp.setBwInputType(m_bwInputType);
274 if (m_gcp.getChMapInputType() != m_chMapInputType) {
275 B2INFO(
"CDCJobCntlParModifier: chMapInputType modified: " << m_gcp.getChMapInputType() <<
" to " << m_chMapInputType);
276 m_gcp.setChMapInputType(m_chMapInputType);
279 if (m_gcp.getEDepToADCInputType() != m_eDepToADCInputType) {
280 B2INFO(
"CDCJobCntlParModifier: edep-to-adc modified: " << m_gcp.getEDepToADCInputType() <<
" to " << m_eDepToADCInputType);
281 m_gcp.setEDepToADCInputType(m_eDepToADCInputType);
284 if (m_gcp.getDisplacementFile() != m_displacementFile) {
285 B2INFO(
"CDCJobCntlParModifier: displacementFile modified: " << m_gcp.getDisplacementFile() <<
" to " << m_displacementFile);
286 m_gcp.setDisplacementFile(m_displacementFile);
289 if (m_gcp.getAlignmentFile() != m_alignmentFile) {
290 B2INFO(
"CDCJobCntlParModifier: alignmentFile modified: " << m_gcp.getAlignmentFile() <<
" to " << m_alignmentFile);
291 m_gcp.setAlignmentFile(m_alignmentFile);
294 if (m_gcp.getMisalignmentFile() != m_misalignmentFile) {
295 B2INFO(
"CDCJobCntlParModifier: misalignmentFile modified: " << m_gcp.getMisalignmentFile() <<
" to " << m_misalignmentFile);
296 m_gcp.setMisalignmentFile(m_misalignmentFile);
299 if (m_gcp.getXtFile() != m_xtFile) {
300 B2INFO(
"CDCJobCntlParModifier: xtFile modified: " << m_gcp.getXtFile() <<
" to " << m_xtFile);
301 m_gcp.setXtFile(m_xtFile);
304 if (m_gcp.getSigmaFile() != m_sigmaFile) {
305 B2INFO(
"CDCJobCntlParModifier: sigmaFile modified: " << m_gcp.getSigmaFile() <<
" to " << m_sigmaFile);
306 m_gcp.setSigmaFile(m_sigmaFile);
309 if (m_gcp.getPropSpeedFile() != m_propSpeedFile) {
310 B2INFO(
"CDCJobCntlParModifier: propSpeedFile modified: " << m_gcp.getPropSpeedFile() <<
" to " << m_propSpeedFile);
311 m_gcp.setPropSpeedFile(m_propSpeedFile);
314 if (m_gcp.getT0File() != m_t0File) {
315 B2INFO(
"CDCJobCntlParModifier: t0File modified: " << m_gcp.getT0File() <<
" to " << m_t0File);
316 m_gcp.setT0File(m_t0File);
319 if (m_gcp.getTwFile() != m_twFile) {
320 B2INFO(
"CDCJobCntlParModifier: timeWalkFile modified: " << m_gcp.getTwFile() <<
" to " << m_twFile);
321 m_gcp.setTwFile(m_twFile);
324 if (m_gcp.getBwFile() != m_bwFile) {
325 B2INFO(
"CDCJobCntlParModifier: badWireFile modified: " << m_gcp.getBwFile() <<
" to " << m_bwFile);
326 m_gcp.setBwFile(m_bwFile);
329 if (m_gcp.getChMapFile() != m_chMapFile) {
330 B2INFO(
"CDCJobCntlParModifier: chMapFile modified: " << m_gcp.getChMapFile() <<
" to " << m_chMapFile);
331 m_gcp.setChMapFile(m_chMapFile);
334 if (m_gcp.getEDepToADCFile() != m_eDepToADCFile) {
335 B2INFO(
"CDCJobCntlParModifier: edep-to-adcFile modified: " << m_gcp.getEDepToADCFile() <<
" to " << m_eDepToADCFile);
336 m_gcp.setEDepToADCFile(m_eDepToADCFile);
339 if (m_gcp.getAddFudgeFactorForSigmaForData() != m_addFudgeFactorForSigmaForData) {
340 B2INFO(
"CDCJobCntlParModifier: addFudgeFactorForSigmaForData modified: " << m_gcp.getAddFudgeFactorForSigmaForData() <<
" to "
341 << m_addFudgeFactorForSigmaForData);
342 m_gcp.setAddFudgeFactorForSigmaForData(m_addFudgeFactorForSigmaForData);
345 if (m_gcp.getAddFudgeFactorForSigmaForMC() != m_addFudgeFactorForSigmaForMC) {
346 B2INFO(
"CDCJobCntlParModifier: addFudgeFactorForSigmaForMC modified: " << m_gcp.getAddFudgeFactorForSigmaForMC() <<
" to " <<
347 m_addFudgeFactorForSigmaForMC);
348 m_gcp.setAddFudgeFactorForSigmaForMC(m_addFudgeFactorForSigmaForMC);
351 if (m_gcp.getMapperGeometry() != m_mapperGeometry) {
352 B2INFO(
"CDCJobCntlParModifier: mapper geometry flag modified: " << m_gcp.getMapperGeometry() <<
" to " << m_mapperGeometry);
353 m_gcp.setMapperGeometry(m_mapperGeometry);
356 if (m_gcp.getMapperPhiAngle() != m_mapperPhiAngle) {
357 B2INFO(
"CDCJobCntlParModifier: mapper phi-angle modified: " << m_gcp.getMapperPhiAngle() <<
" to " << m_mapperPhiAngle);
358 m_gcp.setMapperPhiAngle(m_mapperPhiAngle);
362 void CDCJobCntlParModifierModule::event()
The Class for Detailed Digitization of CDC.
The Class for CDC Geometry Control Parameters.
The Class for CDC Simulation Control Parameters.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.