Skip to content

Commit 5a0a5f3

Browse files
committed
Merge branch 'production/sbnd-gen2' into feature/lynnt_lightcalorimetry_gen2
2 parents 960b575 + 34c80e1 commit 5a0a5f3

10 files changed

Lines changed: 151 additions & 24 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

1818
find_package(cetmodules 3.20.00 REQUIRED)
19-
project(sbncode VERSION 10.14.02 LANGUAGES CXX)
19+
project(sbncode VERSION 10.14.02.04 LANGUAGES CXX)
2020

2121
message(STATUS "\n\n ========================== ${PROJECT_NAME} ==========================")
2222

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,11 @@ namespace caf
647647
"lightcalo"
648648
};
649649

650+
Atom<std::string> fBlipTag {
651+
Name("BlipTag"),
652+
Comment("Provide a string to label the blip input"),
653+
"blipreco"
654+
};
650655
};
651656
}
652657

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "sbncode/CAFMaker/FillExposure.h"
2121
#include "sbncode/CAFMaker/FillTrigger.h"
2222
#include "sbncode/CAFMaker/Utils.h"
23+
#include "sbncode/CAFMaker/FillBlip.h"
2324

2425
// C/C++ includes
2526
#include <fenv.h>
@@ -1960,6 +1961,13 @@ void CAFMaker::produce(art::Event& evt) noexcept {
19601961
}
19611962
}
19621963

1964+
//Fill blips. art::handle for blips and then call fill blips for each one. Make a vector to hold all of them. I handle for loop in Fill blip
1965+
art::Handle<std::vector<blip::Blip>> blipHandle;
1966+
std::vector<caf::SRBlip> srblips;
1967+
if(evt.getByLabel( fParams.fBlipTag(), blipHandle)) //fill SR blips
1968+
{
1969+
FillBlip( *blipHandle, srblips);
1970+
}
19631971
// collect the TPC slices
19641972
std::vector<art::Ptr<recob::Slice>> slices;
19651973
std::vector<std::string> slice_tag_suffixes;
@@ -2642,6 +2650,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
26422650
rec.sbnd_crt_veto = srsbndcrtveto;
26432651
rec.opflashes = srflashes;
26442652
rec.nopflashes = srflashes.size();
2653+
rec.blips = srblips;
26452654
rec.sbnd_frames = srsbndframeshiftinfo;
26462655
rec.sbnd_timings = srsbndtiminginfo;
26472656
rec.soft_trig = srsbndsofttrig;

sbncode/CAFMaker/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ art_make_library( LIBRARY_NAME sbncode_CAFMaker
4040
sbnobj::Common_Trigger
4141
sbnobj::SBND_CRT
4242
sbnobj::SBND_Timing
43+
sbnobj::SBND_Blip
4344
lardataalg::DetectorInfo
4445
art::Framework_Services_System_TriggerNamesService_service
4546
sbncode_Metadata_MetadataSBN_service

sbncode/CAFMaker/FillBlip.cxx

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#include "sbncode/CAFMaker/FillBlip.h"
2+
3+
namespace caf
4+
{
5+
void FillBlip( const std::vector<blip::Blip>& LAr_Blips, std::vector<caf::SRBlip>& CAF_Blips)
6+
{
7+
for(blip::Blip const& CurrentBlip: LAr_Blips)
8+
{
9+
caf::SRBlip NewBlip;
10+
NewBlip.ID = CurrentBlip.ID;
11+
NewBlip.isValid = CurrentBlip.isValid;
12+
NewBlip.cryostat = CurrentBlip.Cryostat;
13+
NewBlip.TPC = CurrentBlip.TPC;
14+
NewBlip.nPlanes = CurrentBlip.NPlanes;
15+
NewBlip.maxWireSpan = CurrentBlip.MaxWireSpan;
16+
NewBlip.timeTick = CurrentBlip.TimeTick;
17+
NewBlip.time = CurrentBlip.Time;
18+
NewBlip.charge = CurrentBlip.Charge;
19+
NewBlip.energy = CurrentBlip.Energy/1000.; //convert to GeV
20+
NewBlip.energyESTAR = CurrentBlip.EnergyESTAR/1000.; //convert to GeV
21+
NewBlip.energyPSTAR = CurrentBlip.EnergyPSTAR/1000.; //convert to GeV
22+
NewBlip.proxTrkDist = CurrentBlip.ProxTrkDist;
23+
NewBlip.proxTrkID = CurrentBlip.ProxTrkID;
24+
NewBlip.inCylinder = CurrentBlip.inCylinder;
25+
NewBlip.position.SetXYZ(CurrentBlip.Position.X(), CurrentBlip.Position.Y(), CurrentBlip.Position.Z());
26+
NewBlip.sigmaYZ = CurrentBlip.SigmaYZ;
27+
NewBlip.dX = CurrentBlip.dX;
28+
NewBlip.dYZ = CurrentBlip.dYZ;
29+
if(CurrentBlip.truth.ID >= 0 ) //MC Blip
30+
{
31+
FillMCTruthBlip( CurrentBlip.truth, NewBlip.truthBlip );
32+
}
33+
for(int iPlane=0; iPlane<int(blip::kNplanes); iPlane++)
34+
{
35+
FillBlipRelatedHitCluster( CurrentBlip.clusters[iPlane], NewBlip.clusters[iPlane] );
36+
}
37+
CAF_Blips.push_back(NewBlip);
38+
}
39+
40+
}
41+
42+
void FillMCTruthBlip( blip::TrueBlip const & TrueLAr_Blip, caf::SRTrueBlip &TrueCAF_Blip )
43+
{
44+
TrueCAF_Blip.ID = TrueLAr_Blip.ID;
45+
TrueCAF_Blip.cryostat = TrueLAr_Blip.Cryostat;
46+
TrueCAF_Blip.TPC = TrueLAr_Blip.TPC;
47+
TrueCAF_Blip.time = TrueLAr_Blip.Time;
48+
TrueCAF_Blip.driftTime = TrueLAr_Blip.DriftTime;
49+
TrueCAF_Blip.energy = TrueLAr_Blip.Energy;
50+
TrueCAF_Blip.depElectrons = TrueLAr_Blip.DepElectrons;
51+
TrueCAF_Blip.numElectrons = TrueLAr_Blip.NumElectrons;
52+
TrueCAF_Blip.leadG4ID = TrueLAr_Blip.LeadG4ID;
53+
TrueCAF_Blip.leadG4Index = TrueLAr_Blip.LeadG4Index;
54+
TrueCAF_Blip.leadG4PDG = TrueLAr_Blip.LeadG4PDG;
55+
TrueCAF_Blip.leadCharge = TrueLAr_Blip.LeadCharge;
56+
TrueCAF_Blip.position.SetXYZ(TrueLAr_Blip.Position.X(), TrueLAr_Blip.Position.Y(), TrueLAr_Blip.Position.Z());
57+
TrueCAF_Blip.energy = TrueCAF_Blip.energy/1000.; //convert to GeV
58+
}
59+
60+
void FillBlipRelatedHitCluster(blip::HitClust const & LAr_HitClust, caf::SRBlipHitClust &CAF_HitClust)
61+
{
62+
CAF_HitClust.ID = LAr_HitClust.ID;
63+
CAF_HitClust.isValid = LAr_HitClust.isValid;
64+
CAF_HitClust.centerChan = LAr_HitClust.CenterChan;
65+
CAF_HitClust.centerWire = LAr_HitClust.CenterWire;
66+
CAF_HitClust.isTruthMatched = LAr_HitClust.isTruthMatched;
67+
CAF_HitClust.isMatched = LAr_HitClust.isMatched;
68+
CAF_HitClust.deadWireSep = LAr_HitClust.DeadWireSep;
69+
CAF_HitClust.cryostat = LAr_HitClust.Cryostat;
70+
CAF_HitClust.TPC = LAr_HitClust.TPC;
71+
CAF_HitClust.plane = LAr_HitClust.Plane;
72+
CAF_HitClust.nHits = LAr_HitClust.NHits;
73+
CAF_HitClust.nWires = LAr_HitClust.NWires;
74+
CAF_HitClust.ADCs = LAr_HitClust.ADCs;
75+
CAF_HitClust.amplitude = LAr_HitClust.Amplitude;
76+
CAF_HitClust.charge = LAr_HitClust.Charge;
77+
CAF_HitClust.sigmaCharge = LAr_HitClust.SigmaCharge;
78+
CAF_HitClust.timeTick = LAr_HitClust.TimeTick;
79+
CAF_HitClust.time = LAr_HitClust.Time;
80+
CAF_HitClust.startTime = LAr_HitClust.StartTime;
81+
CAF_HitClust.endTime = LAr_HitClust.EndTime;
82+
CAF_HitClust.timespan = LAr_HitClust.Timespan;
83+
CAF_HitClust.RMS = LAr_HitClust.RMS;
84+
CAF_HitClust.startWire = LAr_HitClust.StartWire;
85+
CAF_HitClust.endWire = LAr_HitClust.EndWire;
86+
CAF_HitClust.nPulseTrainHits = LAr_HitClust.NPulseTrainHits;
87+
CAF_HitClust.goodnessOfFit = LAr_HitClust.GoodnessOfFit;
88+
CAF_HitClust.blipID = LAr_HitClust.BlipID;
89+
CAF_HitClust.edepID = LAr_HitClust.EdepID;
90+
//These are sets that need to become vectors so we need to do some loops
91+
for(auto HitID : LAr_HitClust.HitIDs) CAF_HitClust.hitIDs.push_back(HitID);
92+
for(auto Wire : LAr_HitClust.Wires) CAF_HitClust.wires.push_back(Wire);
93+
for(auto Chan : LAr_HitClust.Chans) CAF_HitClust.chans.push_back(Chan);
94+
for(auto G4ID : LAr_HitClust.G4IDs) CAF_HitClust.G4IDs.push_back(G4ID);
95+
}
96+
}

sbncode/CAFMaker/FillBlip.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
/**
3+
* @file sbncode/CAFMaker/FillBlip.h
4+
* @brief CAFMaker utilities for filling "blip" objects into CAF.
5+
* @author Jacob McLaughlin ([email protected])
6+
*/
7+
#ifndef CAF_FILLBLIP_H
8+
#define CAF_FILLBLIP_H
9+
#include "sbnanaobj/StandardRecord/SRBlip.h"
10+
#include "sbnobj/SBND/Blip/BlipDataTypes.h"
11+
12+
#include <vector>
13+
14+
namespace caf
15+
{
16+
17+
void FillBlip( const std::vector<blip::Blip>& LAr_Blips, std::vector<caf::SRBlip>& CAF_Blips);
18+
void FillMCTruthBlip( blip::TrueBlip const & TrueLAr_Blip, caf::SRTrueBlip &TrueCAF_Blip );
19+
void FillBlipRelatedHitCluster(blip::HitClust const & LAr_HitClust, caf::SRBlipHitClust &CAF_HitClust);
20+
}
21+
22+
#endif

sbncode/EventGenerator/MeVPrtl/Tools/BNBKaonGen_tool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ simb::MCFlux BNBKaonGen::MakeMCFlux(const bsim::BooNe &boone) {
311311
<< std::endl;
312312
}
313313

314-
flux.fFluxType = simb::kDk2Nu;
314+
flux.fFluxType = simb::kNtuple;
315315
flux.fnimpwt = fBooneNtp.beamwgt;
316316
flux.fvx = fBooneNtp.ini_pos[0][0]; //0
317317
flux.fvy = fBooneNtp.ini_pos[0][1]; //0

sbncode/SBNEventWeight/Calculators/BNBFlux/FluxCalcPrep.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ namespace sbn {
224224
}
225225

226226
//or do the above 3 lines in one line
227-
// auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel);
227+
auto const& mclist = *e.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorModuleLabel);
228228

229229
// If no neutrinos in this event, gives 0 weight;
230230
int NUni = fParameterSet.fNuniverses;
@@ -264,8 +264,8 @@ namespace sbn {
264264
}
265265

266266
// Collect neutrino energy; mclist is replaced with fluxlist.
267-
// double enu= mclist[inu].GetNeutrino().Nu().E();
268267
double enu= fluxlist[inu].fnenergyn;
268+
if ( enu == -1 ) enu= mclist[inu].GetNeutrino().Nu().E(); //For MeVPrtl generator, not all MCFlux result in a neutrino, so equivalent neutrino energy is computed and saved as MCTruth
269269

270270
//Let's make a weights based on the calculator you have requested
271271

sbncode/SinglePhotonAnalysis/jobs/prodgenie_nu_singleinteraction_tpc_NCDeltaRadiative_filtered_sbnd.fcl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
# Simulates GENIE neutrino interactions from the BNB beam
22
# forcing one interaction per event, inside the TPC volume
33
# (with 10 cm padding on each side),
4-
# selecting only NC events with photons coming out from the delta decay
4+
# selecting only NC events with photons coming out from the Delta
55

66

7+
#include "prodgenie_nu_singleinteraction_tpc_sbnd.fcl"
8+
9+
#------ this could be a separated file
710
#
811
# services
912
#
1013

11-
#include "services_sbnd.fcl"
12-
#include "messages_sbnd.fcl"
13-
1414
#
1515
# modules
1616
#
1717

18-
#include "filters_sbnd.fcl"
19-
#include "emptyevent_sbnd.fcl"
20-
#include "genie_sbnd.fcl"
21-
22-
23-
2418

2519

2620
process_name: GenieGenFiltered
@@ -108,5 +102,5 @@ outputs:
108102
# override
109103
# THIS DOES NOT WORK, CHECK!
110104
physics.producers.generator.TopVolume: "volTPCActive"
111-
#physics.producers.generator.BeamName: "booster"
112-
#physics.producers.generator.EventGeneratorList: "NCRES"
105+
physics.producers.generator.BeamName: "booster"
106+
physics.producers.generator.EventGeneratorList: "NCRES"

ups/product_deps

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,14 @@ libdir fq_dir lib
252252
#
253253
####################################
254254
product version qual flags <table_format=2>
255-
genie_xsec v3_06_00 -
255+
genie_xsec v3_06_02_sbn2 -
256256
larcv2 v2_2_6 -
257-
larsoft v10_14_02 -
258-
sbnalg v10_14_02 -
257+
larsoft v10_14_02_02 -
258+
sbnalg v10_14_02_04 -
259259
sbndaq_artdaq_core v1_10_06 -
260260
sbndata v01_08 -
261261
systematicstools v01_04_04 -
262-
nusystematics v1_05_10 -
262+
nusystematics v1_05_10sbn02 -
263263
geant4reweight v01_20_14 -
264264
cetmodules v3_24_01 - only_for_build
265265
end_product_list
@@ -317,10 +317,10 @@ end_product_list
317317
#
318318
####################################
319319
qualifier larsoft sbnalg sbndaq_artdaq_core genie_xsec sbndata larcv2 systematicstools nusystematics geant4reweight notes
320-
c14:debug c14:debug c14:debug c14:s131:debug AR2320i00000:e1000:k250 -nq- c14:debug:p3915 c14:debug c14:debug c14:debug:s131 -nq-
321-
c14:prof c14:prof c14:prof c14:s131:prof AR2320i00000:e1000:k250 -nq- c14:p3915:prof c14:prof c14:prof c14:prof:s131 -nq-
322-
e26:debug e26:debug e26:debug e26:s131:debug AR2320i00000:e1000:k250 -nq- debug:e26:p3915 e26:debug e26:debug e26:debug:s131 -nq-
323-
e26:prof e26:prof e26:prof e26:s131:prof AR2320i00000:e1000:k250 -nq- e26:p3915:prof e26:prof e26:prof e26:prof:s131 -nq-
320+
c14:debug c14:debug c14:debug c14:s131:debug AR2520i00000:e1000:k250 -nq- c14:debug:p3915 c14:debug c14:debug c14:debug:s131 -nq-
321+
c14:prof c14:prof c14:prof c14:s131:prof AR2520i00000:e1000:k250 -nq- c14:p3915:prof c14:prof c14:prof c14:prof:s131 -nq-
322+
e26:debug e26:debug e26:debug e26:s131:debug AR2520i00000:e1000:k250 -nq- debug:e26:p3915 e26:debug e26:debug e26:debug:s131 -nq-
323+
e26:prof e26:prof e26:prof e26:s131:prof AR2520i00000:e1000:k250 -nq- e26:p3915:prof e26:prof e26:prof e26:prof:s131 -nq-
324324
end_qualifier_list
325325
####################################
326326

0 commit comments

Comments
 (0)