Skip to content

Commit 1e2835c

Browse files
Merge branch 'release/v10_12_02_01'
2 parents 664de6b + 82e37ba commit 1e2835c

81 files changed

Lines changed: 88491 additions & 10358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

18-
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.12.02)
18+
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.12.02.01)
1919
find_package(cetmodules REQUIRED)
2020
project(sbndcode LANGUAGES CXX)
2121

sbndcode/BlipRecoSBND/Alg/BlipRecoAlg.cc

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,32 @@ namespace blip {
357357
if (evt.getByLabel(fGeantProducer,pHandle))
358358
art::fill_ptr_vector(plist, pHandle);
359359

360-
// -- SimEnergyDeposits
361-
art::Handle<std::vector<sim::SimEnergyDeposit> > sedHandle;
362-
std::vector<art::Ptr<sim::SimEnergyDeposit> > sedlist;
363-
if (evt.getByLabel(fSimDepProducer,sedHandle)){
364-
art::fill_ptr_vector(sedlist, sedHandle);
365-
}
366-
360+
// -- SimEnergyDeposits (usually dropped in reco
361+
//art::Handle<std::vector<sim::EnergyDeposit> > sedHandle;
362+
std::vector<sim::IDE > sedlist;
363+
//if (evt.getByLabel(fSimDepProducer,sedHandle)){
364+
// art::fill_ptr_vector(sedlist, sedHandle);
365+
// }
367366
// -- SimChannels (usually dropped in reco)
368367
art::Handle<std::vector<sim::SimChannel> > simchanHandle;
369368
std::vector<art::Ptr<sim::SimChannel> > simchanlist;
370-
if (evt.getByLabel(fSimChanProducer,simchanHandle))
369+
if (evt.getByLabel(fSimChanProducer,simchanHandle))
370+
{
371371
art::fill_ptr_vector(simchanlist, simchanHandle);
372+
//Loop over channels to get full sedlist
373+
for(int chIndex=0; chIndex<int(simchanlist.size()); chIndex++)
374+
{
375+
std::vector<geo::WireID> wids = wireReadoutGeom->Get().ChannelToWire( (*(simchanlist[chIndex])).Channel() ); //Not sure why this is a vector, but it should have len 1
376+
const geo::PlaneID& planeID = wids[0].planeID();
377+
if(int(planeID.Plane) != fCaloPlane) continue; //only take calorimetry plane IDE values
378+
std::vector< sim::IDE > TempChIDE = (*simchanlist[chIndex]).TrackIDsAndEnergies(0, 999999999);
379+
for(int ideIndex=0; ideIndex<int(TempChIDE.size()); ideIndex++)
380+
{
381+
//art::fill_ptr_vector(sedlist, simchanHandle.TrackIDsAndEnergies(0, 99999999));
382+
sedlist.push_back( TempChIDE[ideIndex] ); //may need to add a &
383+
}
384+
}
385+
}
372386

373387
// -- hits (from input module, usually track-masked subset of gaushit)
374388
art::Handle< std::vector<recob::Hit> > hitHandle;

sbndcode/BlipRecoSBND/Alg/BlipRecoAlg.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "lardataobj/AnalysisBase/BackTrackerMatchingData.h"
3737
#include "larsim/MCCheater/ParticleInventoryService.h"
3838
#include "larcore/Geometry/Geometry.h"
39+
#include "larcorealg/Geometry/WireReadoutGeom.h"
3940
#include "larcorealg/Geometry/GeometryCore.h"
4041
#include "larreco/Calorimetry/CalorimetryAlg.h"
4142
#include "art/Framework/Principal/Event.h"
@@ -117,6 +118,7 @@ namespace blip {
117118
float kDriftVelocity;
118119
float kTickPeriod;
119120
int kNumChannels;
121+
int fCaloPlane;
120122

121123
private:
122124

@@ -172,7 +174,7 @@ namespace blip {
172174
bool fKeepAllClusts[kNplanes];
173175

174176
// --- Calorimetry configs ---
175-
int fCaloPlane;
177+
//int fCaloPlane;
176178
float fCalodEdx;
177179
float fESTAR_p0;
178180
float fESTAR_p1;

sbndcode/BlipRecoSBND/BlipRecoProducer_module.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ BlipRecoProducer::BlipRecoProducer(fhicl::ParameterSet const & pset)
8888
produces< std::vector< recob::SpacePoint > >();
8989
produces< art::Assns < recob::Hit, recob::SpacePoint> >();
9090
produces< std::vector< blip::Blip > >();
91+
produces< std::vector<blip::HitClust> >();
9192

9293
//produces< art::Assns < blip::Blip, recob::SpacePoint > >();
9394
produces< art::Assns < blip::Blip, recob::Hit> >();
@@ -124,6 +125,7 @@ void BlipRecoProducer::produce(art::Event & evt)
124125
std::unique_ptr< art::Assns <blip::Blip, recob::Hit> > assn_blip_hit_v(std::make_unique<art::Assns<blip::Blip, recob::Hit> >() );
125126
std::unique_ptr< std::vector< recob::SpacePoint> > SpacePoint_v(std::make_unique<std::vector<recob::SpacePoint>>());
126127
std::unique_ptr< art::Assns <recob::Hit, recob::SpacePoint> > assn_hit_sps_v(std::make_unique<art::Assns<recob::Hit,recob::SpacePoint>>() );
128+
std::unique_ptr< std::vector< blip::HitClust> > collection_hitclust(std::make_unique<std::vector<blip::HitClust>>());
127129

128130

129131
art::PtrMaker<blip::Blip> makeBlipPtr(evt);
@@ -180,6 +182,12 @@ void BlipRecoProducer::produce(art::Event & evt)
180182
}
181183

182184
}
185+
//adding all the collection hit clusters
186+
for(int iclust=0; iclust<int(fBlipAlg->hitclust.size()); iclust++)
187+
{
188+
if( (fBlipAlg->hitclust)[iclust].Plane != fBlipAlg->fCaloPlane) continue;
189+
collection_hitclust->push_back((fBlipAlg->hitclust)[iclust]);
190+
}
183191

184192
//===========================================
185193
// Put them on the event
@@ -189,6 +197,7 @@ void BlipRecoProducer::produce(art::Event & evt)
189197
evt.put(std::move(blip_v));
190198
//evt.put(std::move(assn_blip_sps_v));
191199
evt.put(std::move(assn_blip_hit_v));
200+
evt.put(std::move(collection_hitclust));
192201
}//END EVENT LOOP
193202

194203
DEFINE_ART_MODULE(BlipRecoProducer)

sbndcode/BlipRecoSBND/Utils/BlipUtils.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ namespace BlipUtils {
6161
pinfo.depEnergy = 0;
6262
pinfo.depElectrons = 0;
6363
for(auto& sed : sedvec ) {
64-
if( sed->TrackID() == part.TrackId() ) {
65-
pinfo.depEnergy += sed->Energy();
66-
pinfo.depElectrons += sed->NumElectrons();
64+
if( -1*sed.trackID == part.TrackId() || sed.trackID == part.TrackId() ) {
65+
pinfo.depEnergy += sed.energy;
66+
pinfo.depElectrons += sed.numElectrons;
6767
}
6868
}
69-
7069
return;
7170

7271
}
@@ -86,7 +85,7 @@ namespace BlipUtils {
8685
//std::cout<<"Making true blip for "<<part.TrackId()<<" (PDG "<<part.PdgCode()<<", which deposited "<<pinfo[i].depEnergy<<"\n";
8786

8887
// If this is a photon or neutron, don't even bother!
89-
if( part.PdgCode() == 2112 || part.PdgCode() == 22 ) continue;
88+
//if( part.PdgCode() == 2112 || part.PdgCode() == 22 ) continue;
9089

9190
// If this is an electron that came from another electron, it would
9291
// have already been grouped as part of the contiguous "blip" previously.
@@ -139,7 +138,7 @@ namespace BlipUtils {
139138
simb::MCParticle& part = pinfo.particle;
140139

141140
// Skip neutrons, photons
142-
if( part.PdgCode() == 2112 || part.PdgCode() == 22 ) return;
141+
// if( part.PdgCode() == 2112 || part.PdgCode() == 22 ) return;
143142

144143
// Check that path length isn't zero
145144
if( !pinfo.pathLength ) return;

sbndcode/BlipRecoSBND/Utils/BlipUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "TH1D.h"
3939

4040

41-
typedef std::vector<art::Ptr<sim::SimEnergyDeposit>> SEDVec_t;
41+
typedef std::vector<sim::IDE> SEDVec_t;
4242

4343
geo::View_t kViews[3]={geo::kU, geo::kV, geo::kW};
4444

sbndcode/BlipRecoSBND/Utils/classes_def.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<class name="blip::Blip"/>
44
<class name="std::vector<blip::Blip>"/>
55
<class name="blip::HitClust"/>
6+
<class name="std::vector<blip::HitClust>"/>
7+
<class name="art::Wrapper<std::vector<blip::HitClust> >"/>
68
<class name="blip::TrueBlip"/>
79
<class name="std::map<int,TVector3>"/>
810
<class name="art::Assns<blip::Blip,recob::Hit,void>"/>

sbndcode/BlipRecoSBND/blipreco_configs.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sbnd_blipalg:
99
TrkProducer: "blipPandoraTrackCopy" #// input recob::Tracks to use for blip reconstruction
1010
GeantProducer: "largeant" #// input sim::MCParticles (getting true particle info)
1111
SimEDepProducer: "ionandscint" #// input sim::SimEnergyDeposits (getting energy/electrons deposited)
12-
SimChanProducer: "simdrift" #// label for sim::SimChannels (getting drifted charge; optional)
12+
SimChanProducer: "simtpc2d:simpleSC:DetSim" #// label for sim::SimChannels (getting drifted charge; optional)
1313
MaxHitTrkLength: 5.0 #// hits in trks > this length will be vetoed [cm]
1414
DoHitFiltering: false #// filter hits based on amp, width, RMS
1515
HitClustWireRange: 1 #// clustering wire width

sbndcode/CRT/CRTAna/CRTAnalysis_module.cc

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class sbnd::crt::CRTAnalysis : public art::EDAnalyzer {
6363
// Required functions.
6464
void analyze(art::Event const& e) override;
6565

66+
void beginRun(art::Run const& r) override;
67+
6668
void AnalysePTBs(std::vector<art::Ptr<raw::ptb::sbndptb>> &PTBVec);
6769

6870
void AnalyseTDCs(std::vector<art::Ptr<sbnd::timing::DAQTimestamp>> &TDCVec);
@@ -95,8 +97,10 @@ class sbnd::crt::CRTAnalysis : public art::EDAnalyzer {
9597

9698
private:
9799

98-
art::ServiceHandle<CRTGeoService> fCRTGeoService;
99-
TPCGeoAlg fTPCGeoAlg;
100+
art::ServiceHandle<CRTGeoService> fCRTGeoService;
101+
art::ServiceHandle<SBND::CRTChannelMapService> fCRTChannelMapService;
102+
103+
TPCGeoAlg fTPCGeoAlg;
100104
CRTBackTrackerAlg fCRTBackTrackerAlg;
101105

102106
std::string fMCParticleModuleLabel, fSimDepositModuleLabel, fFEBDataModuleLabel, fCRTStripHitModuleLabel,
@@ -640,37 +644,39 @@ sbnd::crt::CRTAnalysis::CRTAnalysis(fhicl::ParameterSet const& p)
640644
fTree->Branch("tdc_offset", "std::vector<uint64_t>", &_tdc_offset);
641645
fTree->Branch("tdc_name", "std::vector<std::string>", &_tdc_name);
642646
}
647+
}
643648

649+
void sbnd::crt::CRTAnalysis::beginRun(art::Run const& r)
650+
{
644651
if(fDebug)
645652
{
646-
for(auto const &[name, tagger] : fCRTGeoService->GetTaggers())
647-
{
648-
std::cout << "Tagger: " << tagger.name << '\n'
649-
<< "X - Min: " << tagger.minX << " Max: " << tagger.maxX << '\n'
650-
<< "Y - Min: " << tagger.minY << " Max: " << tagger.maxY << '\n'
651-
<< "Z - Min: " << tagger.minZ << " Max: " << tagger.maxZ << '\n' << std::endl;
652-
}
653+
std::cout << "\n==================================="
654+
<< "\nTaggers!"
655+
<< "\n===================================";
653656

654-
std::cout << std::endl;
657+
for (auto const &[name, tagger] : fCRTGeoService->GetTaggers())
658+
std::cout << std::endl << tagger;
655659

656-
for(auto const &[name, module] : fCRTGeoService->GetModules())
657-
{
658-
std::cout << "Module: " << module.name << " (" << module.taggerName << ")" << '\n';
659-
if(module.minos)
660-
std::cout << "MINOS module" << std::endl;
661-
std::cout << "X - Min: " << module.minX << " Max: " << module.maxX << " Diff: " << module.maxX - module.minX << '\n'
662-
<< "Y - Min: " << module.minY << " Max: " << module.maxY << " Diff: " << module.maxY - module.minY << '\n'
663-
<< "Z - Min: " << module.minZ << " Max: " << module.maxZ << " Diff: " << module.maxZ - module.minZ << '\n'
664-
<< "Orientation: " << module.orientation << '\n' << std::endl;
665-
}
660+
std::cout << "\n==================================="
661+
<< "\nModules!"
662+
<< "\n===================================";
666663

667-
std::cout << std::endl;
664+
for (auto const &[name, module] : fCRTGeoService->GetModules())
665+
std::cout << std::endl << module;
668666

669-
for(auto const &[name, sipm] : fCRTGeoService->GetSiPMs())
670-
{
671-
std::cout << "SiPM: " << sipm.channel << " (" << sipm.channel/32 << " - " << sipm.channel%32 << ")" << '\n'
672-
<< "x: " << sipm.x << " y: " << sipm.y << " z: " << sipm.z << std::endl;
673-
}
667+
std::cout << "\n==================================="
668+
<< "\nStrips!"
669+
<< "\n===================================";
670+
671+
for (auto const &[name, strip] : fCRTGeoService->GetStrips())
672+
std::cout << std::endl << strip;
673+
674+
std::cout << "\n==================================="
675+
<< "\nSiPMs!"
676+
<< "\n===================================";
677+
678+
for (auto const &[name, sipm] : fCRTGeoService->GetSiPMs())
679+
std::cout << std::endl << sipm;
674680
}
675681
}
676682

@@ -1269,20 +1275,12 @@ void sbnd::crt::CRTAnalysis::AnalyseCRTClusters(const art::Event &e, const std::
12691275
for(unsigned ii = 0; ii < _cl_nhits[i]; ++ii)
12701276
{
12711277
const auto striphit = striphits[ii];
1272-
_cl_channel_set[i][ii] = striphit->Channel();
1273-
_cl_adc_set[i][2*ii] = striphit->ADC1();
1274-
_cl_adc_set[i][2*ii+1] = striphit->ADC2();
1275-
_cl_sh_ts0_set[i][ii] = striphit->Ts0();
1276-
_cl_sh_ts1_set[i][ii] = striphit->Ts1();
1277-
1278-
if(fDataMode)
1279-
{
1280-
art::ServiceHandle<SBND::CRTChannelMapService> ChannelMapService;
1281-
SBND::CRTChannelMapService::ModuleInfo_t module_info = ChannelMapService->GetModuleInfoFromOfflineID( striphit->Channel() / 32 );
1282-
_cl_sh_feb_mac5_set[i][ii] = ( module_info.valid ) ? module_info.feb_mac5 : 0;
1283-
}
1284-
else
1285-
_cl_sh_feb_mac5_set[i][ii] = striphit->Channel() / 32;
1278+
_cl_channel_set[i][ii] = striphit->Channel();
1279+
_cl_adc_set[i][2*ii] = striphit->ADC1();
1280+
_cl_adc_set[i][2*ii+1] = striphit->ADC2();
1281+
_cl_sh_ts0_set[i][ii] = striphit->Ts0();
1282+
_cl_sh_ts1_set[i][ii] = striphit->Ts1();
1283+
_cl_sh_feb_mac5_set[i][ii] = fCRTChannelMapService->GetMAC5FromOfflineChannelID(striphit->Channel());
12861284

12871285
/*
12881286
* The below segment reimplements the CorrectTime() method

sbndcode/CRT/CRTAna/run_crtana.fcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "crtgeoservice_sbnd.fcl"
1+
#include "crt_services_sbnd.fcl"
22
#include "crtana_sbnd.fcl"
33
#include "simulationservices_sbnd.fcl"
44

@@ -8,12 +8,12 @@ services:
88
{
99
TFileService: { fileName: "crtana_sbnd.root" }
1010
@table::sbnd_basic_services
11+
@table::crt_services_sbnd
1112
ParticleInventoryService: @local::sbnd_particleinventoryservice
1213
BackTrackerService: @local::sbnd_backtrackerservice
1314
DetectorClocksService: @local::sbnd_detectorclocks
1415
LArPropertiesService: @local::sbnd_properties
1516
DetectorPropertiesService: @local::sbnd_detproperties
16-
CRTGeoService: @local::crtgeoservice_sbnd
1717
}
1818

1919
source:

0 commit comments

Comments
 (0)