Definition at line 27 of file NormalizeDrift_tool.cc.
icarus::calo::NormalizeDrift::NormalizeDrift |
( |
fhicl::ParameterSet const & |
pset | ) |
|
void icarus::calo::NormalizeDrift::configure |
( |
const fhicl::ParameterSet & |
pset | ) |
|
|
overridevirtual |
Definition at line 78 of file NormalizeDrift_tool.cc.
86 std::string url =
URL(run);
88 if (
fVerbose)
std::cout <<
"NormalizeDrift Tool -- New Run info, requesting data from url:\n" << url << std::endl;
93 throw cet::exception(
"NormalizeDrift") <<
"Calibration Database access failed. URL: (" << url <<
") Error Code: " <<
error;
96 if (
fVerbose)
std::cout <<
"NormalizeDrift Tool -- Received HTTP response:\n" << getHTTPmessage(d) << std::endl;
98 if (getHTTPstatus(d) != 200) {
99 throw cet::exception(
"NormalizeDrift")
100 <<
"Calibration Database access failed. URL: (" << url
101 <<
"). HTTP error status: " << getHTTPstatus(d) <<
". HTTP error message: " << getHTTPmessage(d);
106 std::vector<bool> tpc_set(4,
false);
117 int ch = getLongValue(tup, 0, &err);
119 throw cet::exception(
"NormalizeDrift") <<
"Calibration Database access failed. URL: (" << url <<
") Failed on tuple access, row: " <<
row <<
", col 0. Error Code: " <<
error;
123 double tau = getDoubleValue(tup, 1, &err);
125 throw cet::exception(
"NormalizeDrift") <<
"Calibration Database access failed. URL: (" << url <<
") Failed on tuple access, row: " <<
row <<
", col 1. Error Code: " <<
error;
129 if (ch < 0 || ch > 3) {
130 throw cet::exception(
"NormalizeDrift") <<
"Calibration Database access failed. URL: (" << url <<
") Bad channel number: " << ch;
133 tpc_set.at(ch) =
true;
136 if (ch == 0) thisrun.tau_EE = tau;
137 if (ch == 1) thisrun.tau_EW = tau;
138 if (ch == 2) thisrun.tau_WE = tau;
139 if (ch == 3) thisrun.tau_WW = tau;
142 if (
fVerbose)
std::cout <<
"NormalizeDrift Tool -- Lifetime Data:" <<
"\nTPC EE: " << thisrun.tau_EE <<
"\nTPC EW: " << thisrun.tau_EW <<
"\nTPC WE: " << thisrun.tau_WE <<
"\nTPC WW: " << thisrun.tau_WW << std::endl;
145 for (
unsigned tpc = 0; tpc < 4; tpc++) {
147 throw cet::exception(
"NormalizeDrift") <<
"Calibration Database access failed. URL: (" << url <<
") TPC not set: " << tpc;
EResult err(const char *call)
std::string URL(uint32_t run)
std::map< uint32_t, RunInfo > fRunInfos
BEGIN_PROLOG could also be cout
double icarus::calo::NormalizeDrift::Normalize |
( |
double |
dQdx, |
|
|
const art::Event & |
e, |
|
|
const recob::Hit & |
h, |
|
|
const geo::Point_t & |
location, |
|
|
const geo::Vector_t & |
direction, |
|
|
double |
t0 |
|
) |
| |
|
overridevirtual |
Implements INormalizeCharge.
Definition at line 157 of file NormalizeDrift_tool.cc.
160 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
e);
163 RunInfo runelifetime =
GetRunInfo(
e.id().runID().run());
166 double thiselifetime = -1;
167 unsigned tpc =
hit.WireID().TPC;
168 unsigned cryo =
hit.WireID().Cryostat;
171 if (cryo == 0 && (tpc == 0 || tpc == 1)) thiselifetime = runelifetime.tau_EE;
173 if (cryo == 0 && (tpc == 2 || tpc == 3)) thiselifetime = runelifetime.tau_EW;
175 if (cryo == 1 && (tpc == 0 || tpc == 1)) thiselifetime = runelifetime.tau_WE;
177 if (cryo == 1 && (tpc == 2 || tpc == 3)) thiselifetime = runelifetime.tau_WW;
180 double thit = clock_data.TPCTick2TrigTime(
hit.PeakTime()) -
t0;
182 if (
fVerbose)
std::cout <<
"NormalizeDrift Tool -- Norm factor: " <<
exp(thit / thiselifetime) <<
" at TPC: " << tpc <<
" Cryo: " << cryo <<
" Time: " << thit <<
" Track T0: " <<
t0 << std::endl;
185 if (thiselifetime > 0) {
186 dQdx = dQdx*
exp(thit / thiselifetime);
RunInfo GetRunInfo(uint32_t run)
BEGIN_PROLOG could also be cout
std::string icarus::calo::NormalizeDrift::URL |
( |
uint32_t |
run | ) |
|
|
private |
std::map<uint32_t, RunInfo> icarus::calo::NormalizeDrift::fRunInfos |
|
private |
int icarus::calo::NormalizeDrift::fTimeout |
|
private |
std::string icarus::calo::NormalizeDrift::fURL |
|
private |
bool icarus::calo::NormalizeDrift::fVerbose |
|
private |
The documentation for this class was generated from the following file: