30 "Disable CDC timing Cuts if this variable is not zero!");
34 "Do not convert CDC digitized hits into DCDCHit objects"
35 " that would have q less than this");
40 "Remove hits correlated in time with saturation hits!");
44 "Cut in units of 8ns bins to remove correlated hits with Saturation hits!");
48 "Location of peak time around which we cut correlated times in units of 8ns bins");
52 SetFactoryFlag(NOT_OBJECT_OWNER);
65 vector<double> cdc_timing_cuts;
67 if (eventLoop->GetCalib(
"/CDC/timing_cut", cdc_timing_cuts)){
70 jout <<
"Error loading /CDC/timing_cut ! set defaul values -60. and 900." << endl;
77 gPARMS->SetDefaultParameter(
"CDCHit:LowTCut",
LowTCut,
"Minimum acceptable CDC hit time (ns)");
78 gPARMS->SetDefaultParameter(
"CDCHit:HighTCut",
HighTCut,
"Maximum acceptable CDC hit time (ns)");
86 jout <<
"Disable CDC Hit Timing Cuts!" << endl;
104 vector<const DCDCHit*> hits;
105 loop->Get(hits,
"Calib");
108 vector<cdchit_info_t> hit_info_vec;
111 for (
unsigned int k=0 ;k<hits.size(); k++){
113 vector <const Df125CDCPulse*> pulse;
117 if(pulse.size()==0) {
131 cout <<
"Cannot find Translation Table data for hit on ring " << hit->
ring
132 <<
" straw " << hit->
straw <<
", skipping this info ..." << endl;
136 hit_info.
rocid = pulse[0]->rocid;
137 hit_info.
slot = pulse[0]->slot;
138 hit_info.
connector = pulse[0]->channel / 24;
141 hit_info.
time = hit->
t;
148 hit_info_vec.push_back(hit_info);
152 vector<bool> Mark4Removal(hit_info_vec.size(),
false);
156 for (
unsigned int k=0 ;k<hit_info_vec.size()-1; k++){
158 if (hit_info_vec[k].
max){
160 for (
unsigned int n=k+1 ;n<hit_info_vec.size(); n++){
166 if(hit_info_vec[k] == hit_info_vec[n]) {
167 double dt = (hit_info_vec[k].time - hit_info_vec[n].time)/8.;
169 Mark4Removal[n] =
true;
182 for (
int k=0 ;k<(int) hits.size(); k++){
191 if ( hit->
amp <= 0 ) {
196 if ( (hit->
QF & 0x1) != 0 ) {
207 if (Mark4Removal.size() > 0 && Mark4Removal[k]){
211 _data.push_back( const_cast<DCDCHit*>(hit) );
int RemoveCorrelationHits
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
jerror_t fini(void)
Called after last event of last event source has been processed.
static double DIGI_THRESHOLD
jerror_t init(void)
Called once at program start.
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
vector< const DTranslationTable * > ttab
int Disable_CDC_TimingCuts
double CorrelationHitsCut