// ********************************************** // initialize according to base class hits; // then create hit selection array // ********************************************** inline hitsel::hitsel(float dlim,float tlim, float twin,float resolution,float tcoincidence, int ns,float *set,float *pmt_loc,int *bad_ch, int n_raw,int *cable,float *tim_raw,float *chg_raw): hits(ns,set,pmt_loc,bad_ch,n_raw,cable,tim_raw,chg_raw) { select(dlim,tlim,twin,resolution,tcoincidence); } inline hitsel::hitsel(float dlim,float tlim, float twin,float resolution,float tcoincidence, int ns,float *set,pmt_geometry *geom, int n_raw,int *cable,float *tim_raw,float *chg_raw): hits(ns,set,geom,n_raw,cable,tim_raw,chg_raw) { select(dlim,tlim,twin,resolution,tcoincidence); } inline hitsel::hitsel(float dlim,float tlim, float twin,float resolution,float tcoincidence, int ns,float *set,pmt_geometry *geom,comtype2 *itevent): hits(ns,set,geom,itevent) { int sel; float sel_cable; select(dlim,tlim,twin,resolution,tcoincidence); for(sel=0; selit_index; ns++) if (sel_cable==itevent->hits[ns][0]) { itevent->hits[ns][0]=-sel_cable; break; } } } inline hitsel::hitsel(int ns,float *set,pmt_geometry *geom,comtype2 *itevent): hits(ns,set,geom,itevent) { int hit; for(nsel=hit=0; hitit_index; hit++) if (itevent->hits[hit][0]<0) nsel++; if (nsel==0) selected=new short int[1]; else selected=new short int[nsel]; for(nsel=hit=0; hitit_index; hit++) if (itevent->hits[hit][0]<0) if (position(hit)>=0) selected[nsel++]=position(hit); hits::qsort(selected,nsel); } // ********************************************** // return number of selected hits // ********************************************** inline int hitsel::nselected(void) { return(nsel); } // ********************************************** // return number of selected hits // ********************************************** inline short int hitsel::sel(int i) { if ((i>=0) && (i=twin) return(0); return(delta_t*delta_t