27 #include "art_root_io/TFileService.h" 35 #include "dune-raw-data/Overlays/CRTFragment.hh" 36 #include "artdaq-core/Data/ContainerFragment.hh" 41 #include "TLorentzVector.h" 56 #include "canvas/Persistency/Common/FindManyP.h" 148 consumes<std::vector<raw::RDTimeStamp>>(
fTimeLabel);
149 consumes<std::vector<raw::ctb::pdspctb>>(
fCTBLabel);
150 consumes<std::vector<CRT::Trigger>>(
fCRTLabel);
191 for(
int h=0;
h<32;
h++){
199 fTree = tFileService->make<TTree>(
"ProtoDUNE_Evt_Match",
"ProtoDUNE Matched Event Tree");
250 if(timeStamps.isValid() && timeStamps->size() == 1){
256 mf::LogWarning(
"Empty Event TimeStamp") <<
"Invalid Event TimeStamp. Skipping. \n";
260 if (trigger !=13)
return;
263 if(crtHandle->empty()){
264 mf::LogWarning(
"Empty CRT Fragment") <<
"Empty CRT fragments for this event. Skipping. \n";
269 if(OpHitHandle->empty()){
270 mf::LogWarning(
"Empty OpHit Object") <<
"Empty OpHit Object. Error in retrieval. Skipping. \n";
275 if(ctbHandle->empty()){
276 mf::LogWarning(
"Empty CTB Fragment") <<
"Empty CTB fragment for this event. Skipping. \n";
280 if(ctbHandle->size() > 1){
281 mf::LogWarning(
"Multiple CTB Triggers") <<
"Found " << ctbHandle->size() <<
" CTB data products. Skipping. \n";
285 const auto& ctbStatus = ctbHandle->front();
286 const auto statuses = ctbStatus.GetChStatusAfterHLTs();
289 for(
const auto& status: statuses){
307 if(status.crt != 0) {
310 if(!crtHandle->empty()){
311 std::vector<CRT::Trigger> inWindow(crtHandle->size());
312 const int64_t ctbetime = status.timestamp;
313 const auto newEnd = std::copy_if(crtHandle->begin(), crtHandle->end(), inWindow.begin(),[
this,ctbetime](
const auto& trigger){
316 for(
size_t k=0;
k<inWindow.size();++
k){
321 for(
const auto& OpHit: *OpHitHandle){
322 if(OpHit.PE() < 10.0 || OpHit.PE() > 1000.00)
continue;
323 fPDS_time.push_back((OpHit.PeakTime()/3));
324 fOpChan.push_back(OpHit.OpChannel());
325 fPE.push_back(OpHit.PE());
329 std::vector<art::Ptr<recob::Track>> PandoTrk;
332 mf::LogWarning(
"Empty PandoTrk Fragment") <<
"Empty PandoTrk Vector for this event. Skipping. \n";
338 mf::LogWarning(
"Empty PFParticle Vector") <<
"Empty PFParticle Vector for this event. Skipping. \n";
341 art::FindManyP<recob::PFParticle> PFPar(PandoTrkHandle,e,
fPandoLabel);
344 for(
size_t p = 0;
p<PandoTrk.size();++
p){
345 auto & Trk = PandoTrk[
p];
346 if(!((Trk->Vertex().Z() < 40) || (Trk->End().Z() < 40)))
continue;
347 if(!((Trk->Vertex().Z() > 660) || (Trk->End().Z() > 660)))
continue;
355 auto &PFPS = PFPar.at(Trk.key());
357 auto &T0S = PFT0.at(PFPS[0].
key());
359 t0temp = T0S[0]->Time();
364 if(PandoTrk.size() > 0) pat =
true;
366 if(pat)
fTree->Fill();
PDSPmatch(fhicl::ParameterSet const &p)
std::vector< double > fTrkDSPixelProy_Pando
std::vector< double > fTrkTheta_Pando
const art::InputTag fCTBLabel
const art::InputTag fOpHitLabel
uint16_t GetFlags() const
std::vector< double > fTrkEndz_Pando
std::vector< double > fTrkPhi_Pando
const art::InputTag fCRTLabel
std::vector< double > fTrkDSPosy_Pando
const uint64_t fCRTWindow
std::vector< double > fTrkUSPixelProx_Pando
EDAnalyzer(fhicl::ParameterSet const &pset)
const art::InputTag fPandoLabel
std::vector< double > fOpChan
pure virtual base interface for detector clocks
std::vector< double > fTrkDSPixelProx_Pando
const art::InputTag fPFParListLabel
std::vector< double > fTrkUSPos1y_Pando
std::vector< double > fTrkEndx_Pando
void analyze(art::Event const &e) override
Access the description of detector geometry.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::vector< double > fTrkUSPixelProy_Pando
std::vector< double > fPE
#define DEFINE_ART_MODULE(klass)
std::vector< uint32_t > fTrkProUS_Pando
const int64_t fCRTCTBOffset
unsigned __int64 uint64_t
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
std::vector< TVector3 > PMTracks
std::vector< double > fTrkStarty_Pando
std::vector< double > fTrkStartx_Pando
SubRunNumber_t subRun() const
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
ULong64_t GetTimeStamp() const
Provides recob::Track data product.
std::vector< int64_t > fCRT_time
std::vector< uint32_t > fCRTChan
Encapsulate the geometry of an optical detector.
std::vector< double > fTrkUSPos2x_Pando
std::vector< double > fTrigCos_Pando
const art::InputTag fTimeLabel
std::vector< int64_t > fPDS_time
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
EventNumber_t event() const
std::vector< double > fTrkUSPos2y_Pando
std::vector< int64_t > fPando_time
PDSPmatch & operator=(PDSPmatch const &)=delete
std::vector< double > fTrkEndy_Pando
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
std::vector< double > fTrkStartz_Pando
std::vector< double > fTrkUSPos1x_Pando
std::vector< uint32_t > fTrkProDS_Pando
std::vector< double > fTrkDSPosx_Pando
std::vector< TVector3 > PandoTracks
Event finding and building.
h
training ###############################
ChannelMappingService::Channel Channel