8 #include <phparameter/PHParameters.h>
33 , m_SteppingAction(nullptr)
53 std::string nodenameVirtSheet;
65 dstNode = superSubNode;
71 nodename =
"G4HIT_" +
Name();
74 nodenameVirtSheet = nodename +
"_VirtSheet";
76 PHG4HitContainer *rp_hits = findNode::getClass<PHG4HitContainer>(topNode, nodename);
77 PHG4HitContainer *rp_hitsVirtSheet = findNode::getClass<PHG4HitContainer>(topNode, nodenameVirtSheet);
83 if( ! rp_hitsVirtSheet )
91 tmp->HitNodeName(nodename);
92 tmp->HitNodeNameVirt(nodenameVirtSheet);
137 std::string calibroot = std::string(getenv(
"CALIBRATIONROOT"));
139 if ( calibroot.empty() )
141 std::cout <<
PHWHERE <<
"no CALIBRATIONROOT environment variable" << std::endl;
145 filename = calibroot +
"/RomanPots/RP_parameters_IP6.dat";
160 for(
int l=1; l <= 4; l++ ) {
180 std::ifstream infile;
184 infile.open( paramFile );
186 if(!infile.is_open()) {
187 std::cout <<
PHWHERE <<
"ERROR in EICG4RPSubsystem: Failed to open parameter file " << paramFile << std::endl;
191 while( std::getline(infile, line) ) {
196 std::istringstream iss( line );
199 if( line.find(
"#") != std::string::npos ) {
continue; }
200 if( line.empty() ==
true ) {
continue; }
203 if( !(iss >> name >> value) ) {
204 std::cout <<
PHWHERE <<
" RP parameters: could not decode " << line << std::endl;
209 if( name.find(
"beamHoleHW") == std::string::npos ) {
214 std::string
prefix = name.substr( 0, name.find(
"__") );
215 std::string expected_string =
prefix;
218 expected_string +=
"__eA";
220 double ionE_diff_1 = fabs(
m_ionE - 110 );
221 double ionE_diff_2 = fabs(
m_ionE - 41 );
222 double elecE_diff_1 = fabs(
m_elecE - 18 );
223 double elecE_diff_2 = fabs(
m_elecE - 10 );
224 double elecE_diff_3 = fabs(
m_elecE - 5 );
226 if( ionE_diff_2 < ionE_diff_1 ) {
227 expected_string +=
"_41x5";
230 if( elecE_diff_3 < elecE_diff_2 ) { expected_string +=
"_110x5"; }
231 else if( elecE_diff_2 < elecE_diff_1 ) { expected_string +=
"_110x10"; }
232 else { expected_string +=
"_110x18"; }
236 if(
m_beamProfile.find(
"high-acceptance") != std::string::npos ) {
237 expected_string +=
"__epHA";
240 expected_string +=
"__epHD";
243 double ionE_diff_1 = fabs(
m_ionE - 275 );
244 double ionE_diff_2 = fabs(
m_ionE - 100 );
245 double ionE_diff_3 = fabs(
m_ionE - 41 );
246 double elecE_diff_1 = fabs(
m_elecE - 18 );
247 double elecE_diff_2 = fabs(
m_elecE - 10 );
248 double elecE_diff_3 = fabs(
m_elecE - 5 );
250 if( ionE_diff_3 < ionE_diff_2 ) {
251 expected_string +=
"_41x5";
253 else if( ionE_diff_2 < ionE_diff_1 ) {
254 if( elecE_diff_3 < elecE_diff_2 ) { expected_string +=
"_100x5"; }
255 else { expected_string +=
"_100x10"; }
258 if( elecE_diff_2 < elecE_diff_1 ) { expected_string +=
"_275x10"; }
259 else { expected_string +=
"_275x18"; }
264 if( name.compare( expected_string ) != 0 ) {
continue; }