36 if(a->
t != b->
t )
return a->
t < b->
t;
68 _log =
new JStreamLog(std::cout,
"DFDCCathodeCluster >>");
84 gPARMS->SetDefaultParameter(
"FDC:CLUSTER_TIME_SLICE",
TIME_SLICE);
94 vector<const DFDCHit*> allHits;
95 vector<const DFDCHit*> uHits;
96 vector<const DFDCHit*> vHits;
97 vector<vector<const DFDCHit*> >thisLayer;
100 eventLoop->Get(allHits);
102 if (allHits.size()>0) {
107 for (vector<const DFDCHit*>::iterator i = allHits.begin();
108 i != allHits.end(); ++i){
110 if ((*i)->plane == 1)
120 vector<const DFDCHit*>::iterator i = uHits.begin();
121 for (
int iLayer=1;iLayer<25;iLayer++){
122 if (i==uHits.end())
break;
124 vector<const DFDCHit*> hits;
125 float old_time=(*i)->t;
126 while((i!=uHits.end()) && ((*i)->gLayer == iLayer)){
132 thisLayer.push_back(hits);
143 thisLayer.push_back(hits);
146 for (
unsigned int k=0;k<thisLayer.size();k++)
pique(thisLayer[k]);
157 vector<const DFDCHit*>::iterator i = vHits.begin();
158 for (
int iLayer=1;iLayer<25;iLayer++){
159 if (i==vHits.end())
break;
161 vector<const DFDCHit*> hits;
162 float old_time=(*i)->t;
163 while((i!=vHits.end()) && ((*i)->gLayer == iLayer)){
169 thisLayer.push_back(hits);
180 thisLayer.push_back(hits);
183 for (
unsigned int k=0;k<thisLayer.size();k++)
pique(thisLayer[k]);
195 catch (JException d) {
199 cerr <<
"exception caught in DFDCCathodeCluster_factory" << endl;
218 for(uint32_t istart=0; istart<H.size(); istart++){
219 const DFDCHit *first_hit = H[istart];
222 uint32_t iend=istart+1;
223 for(; iend<H.size(); iend++){
224 if(iend>=H.size())
break;
225 if( (H[iend]->element - H[iend-1]->element) > 1 )
break;
227 if( (iend-istart)<2 )
continue;
232 newCluster->
q_tot = 0.0;
236 for(uint32_t i=istart; i<iend; i++){
237 newCluster->
q_tot += H[i]->q;
238 newCluster->
members.push_back(H[i]);
240 _data.push_back(newCluster);
bool DFDCHit_cmp(const DFDCHit *a, const DFDCHit *b)
DFDCCathodeCluster_factory()
DFDCCathodeCluster_factory::DFDCCathodeCluster_factory(): default constructor–initializes log file...
bool DFDCHit_time_cmp(const DFDCHit *a, const DFDCHit *b)
DFDCHit_time_cmp() a non-member function passed to std::stable_sort() for sorting DFDCHit pointers in...
vector< const DFDCHit * > members
DANA identifier.
~DFDCCathodeCluster_factory()
DFDCCathodeCluster_factory::~DFDCCathodeCluster_factory(): default destructor–closes log file...
bool DFDCHit_element_cmp(const DFDCHit *a, const DFDCHit *b)
DFDCHit_element_cmp(): a non-member function passed to std::sort() for sorting DFDCHit pointers by th...
float q_tot
total energy/charge deposited in the cluster
bool DFDCHit_gLayer_cmp(const DFDCHit *a, const DFDCHit *b)
DFDCHit_gLayer_cmp(): a non-member function passed to std::sort() for sorting DFDCHit pointers by the...
int gPlane
#1-74, which plane out of all FDC modules
#define HIT_TIME_DIFF_MIN
void pique(vector< const DFDCHit * > &h)
DFDCCathodeCluster_factory::pique(): takes a single layer's worth of cathode hits and attempts to cre...
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventNo)
DFDCCathodeCluster_factory::evnt(): This (along with DFDCCathodeCluster_factory::pique()) is the plac...
int gLayer
#1-24, which detection layer of all FDC
bool DFDCCathodeCluster_gPlane_cmp(const DFDCCathodeCluster *a, const DFDCCathodeCluster *b)
DFDCCathodeCluster_gPlane_cmp(): a non-member function passed to std::sort() for sorting DFDCCathodeC...
jerror_t init(void)
Initialization.
class DFDCHit: definition for a basic FDC hit data type.