25 #include "RunHistory/RunHistory.h" 28 #include "DAQChannelMap/DAQChannelMap.h" 29 #include "NovaDAQConventions/DAQConventions.h" 165 hall = tfs->
make<TH1F>(
"hall",
"All W; PE; Number of Hits", 1000, 0, 1000);
166 hexp = tfs->
make<TH1F>(
"hexp",
"Total Exposure;;",1,0,1);
169 for(
int i = 0;
i < 15;
i++){
171 char *hxname =
new char[10];
172 sprintf(hxname,
"hx%d",
i);
173 char *hyname =
new char[10];
174 sprintf(hyname,
"hy%d",
i);
176 char *htitle =
new char[100];
178 int lower = (offset+(
i*100));
179 int upper = offset+(100+(
i*100));
180 sprintf(htitle,
"%d cm < W < %d cm ; PE; Number of Hits", lower, upper );
182 hx[
i] = tfs->
make<TH1F>(hxname, htitle, 1000, 0, 1000);
183 hy[
i] = tfs->
make<TH1F>(hyname, htitle, 1000, 0, 1000);
189 fHitTree->Branch(
"run", &
fRun);
190 fHitTree->Branch(
"subrun", &
fSubRun);
191 fHitTree->Branch(
"event", &
fEvent);
192 fHitTree->Branch(
"plane", &
fPlane);
193 fHitTree->Branch(
"cell", &
fCell);
194 fHitTree->Branch(
"diblock", &
fDiblock);
195 fHitTree->Branch(
"dcm", &
fDcm);
196 fHitTree->Branch(
"apd", &
fApd);
197 fHitTree->Branch(
"pixel", &
fPixel);
198 fHitTree->Branch(
"view", &
fView);
199 fHitTree->Branch(
"pe", &
fPe);
200 fHitTree->Branch(
"w", &
fW);
201 fHitTree->Branch(
"path", &
fPath);
202 fHitTree->Branch(
"tns", &
fTns);
203 fHitTree->Branch(
"readdist", &
fReadDist);
205 fHitTree->Branch(
"isxyadj", &
fIsXYAdj);
206 fHitTree->Branch(
"iszadj", &
fIsZAdj);
207 fHitTree->Branch(
"isavg", &
fIsAvg);
208 fHitTree->Branch(
"isbadtrk", &
fIsBadTrk);
209 fHitTree->Branch(
"isbad", &
fIsBad);
228 char *htitle =
new char[100];
229 sprintf(htitle,
"Threshold Map For Run %d;Plane;Cell", run);
231 char *hname =
new char[20];
232 sprintf(hname,
"thresh-%d", run);
233 hthresh = tfs->
make<TH2F>(hname, htitle, 1792, -0.5, 1791.5, 384, -0.5, 383.5);
237 for(
int idb = 0; idb < ndb; ++idb){
239 std::vector< nova::dbi::RunHistory::DCM > dcms = thisdb.
dcm;
240 int ndcm = dcms.size();
242 for(
int idcm = 0; idcm < ndcm; ++idcm){
244 std::vector< nova::dbi::RunHistory::FEB > febs = thisdcm.
feb;
245 int nfeb = febs.size();
247 for(
int ifeb =0; ifeb < nfeb; ++ifeb){
249 std::vector< int16_t > thresh = thisfeb.
pixelThresh;
250 int npix = thresh.size();
252 for(
int ipix = 0; ipix < npix; ++ipix){
254 uint32_t daqchan = cmap->
encodeDChan( det, thisdb.
num, idcm+1, ifeb, ipix);
261 if (thresh[ipix] != 4095)
262 hthresh->Fill( plane, cell, thresh[ipix]);
296 int nTrks = trkCol->size();
299 for(
int iTrk = 0; iTrk < nTrks; ++iTrk){
303 if ((track->
NXCell()==0) || (track->
NYCell()==0))
continue;
306 std::vector<art::Ptr<caldp::PCHit> > pcxy = fmpcxy.at(iTrk);
307 std::vector<art::Ptr<caldp::PCHit> > pcz = fmpcz.at(iTrk);
308 std::vector<art::Ptr<caldp::PCHit> > pcav = fmpcav.at(iTrk);
309 std::vector<art::Ptr<caldp::PCHit> > pcbt = fmpcbt.at(iTrk);
319 for(
auto const& iPc: pcxy ){
336 if( fPlane < 128 && fIsXYAdj && fTrkPlanes > 20){
338 for(
int iH = 0; iH < 15; ++iH){
340 if(
fW > offset+(iH*100) &&
fW < offset+(100+(iH*100)) ){
357 for(
auto const& iPc: pcz ){
380 for(
auto const& iPc: pcav ){
403 for(
auto const& iPc: pcbt ){
SubRunNumber_t subRun() const
int NDiBlocks()
gives number of active diblocks only, may be less than 14
void analyze(art::Event const &e)
< analyze function
std::string fExpLabel
Cosmic exposure module label name.
std::string fCellHitLabel
std::string fQualBadLabel
Instance label for hits with bad track quality.
bool LoadPixelInfo(int nAttempt=0)
DiBlock GetDiBlock(int i, bool loadAll=true)
get ith diblock is RH list (which only includes diblocks with activity), starting with i=0...
Vertical planes which measure X.
virtual ~PEResponse()
< Destructor
void beginRun(art::Run const &r)
DEFINE_ART_MODULE(TestTMapFile)
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
std::vector< int16_t > pixelThresh
Horizontal planes which measure Y.
std::string fQualZLabel
Instance label for hits with z quality.
static DAQChannelMap * getInstance(int detID)
T get(std::string const &key) const
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
fvar< T > exp(const fvar< T > &x)
std::string fPCHitLabel
PCHit module label.
nova::dbi::RunHistory fRunHist
std::string fTrkLabel
Track module label.
void beginJob()
< beginJob function
EventNumber_t event() const
EDAnalyzer(Table< Config > const &config)
unsigned int NYCell() const
Number of cells in the y-view.
T * make(ARGS...args) const
void reconfigure(fhicl::ParameterSet const &p)
< Reconfigure parameter set
std::vector< TH2F * > fThreshHists
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
art::ServiceHandle< geo::Geometry > fGeom
unsigned int NXCell() const
Number of cells in the x-view.
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
std::string fQualAvgLabel
Instance label for hits with avg quality.
cmap::CMap class source code
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
bool IsBad(int plane, int cell)
void endSubRun(art::SubRun const &sr)
std::string fQualXYLabel
Instance label for hits with xz quality.
Encapsulate the geometry of one entire detector (near, far, ndos)
PEResponse(fhicl::ParameterSet const &p)
< Constructor
TTree * fHitTree
Tree to save hit information.