Skip to content

Commit 6b0f6a8

Browse files
committed
generally cleaning up indentation
1 parent 90c1dd7 commit 6b0f6a8

3 files changed

Lines changed: 49 additions & 50 deletions

File tree

sbndcode/BlipRecoSBND/Alg/BlipRecoAlg.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace blip {
4040
auto const& tpcid = geo::TPCID(cryoid,tpc);
4141

4242
// Loop planes in TPC 'tpc'
43-
auto const& plane0id = geo::PlaneID(cstat,tpc,0);
44-
auto const& plane0geo = wireReadoutGeom->Get().Plane(plane0id);
43+
auto const& plane0id = geo::PlaneID(cstat,tpc,0);
44+
auto const& plane0geo = wireReadoutGeom->Get().Plane(plane0id);
4545
for(size_t pl=0; pl<wireReadoutGeom->Get().Nplanes(tpcid); pl++){
4646
auto const& planeid = geo::PlaneID(cstat,tpc,pl);
4747
auto const& planegeo = wireReadoutGeom->Get().Plane(planeid);
@@ -63,7 +63,7 @@ namespace blip {
6363
auto const& tpcgeom = cryostat.TPC(tpc);
6464
auto const xyz = plane0geo.GetCenter();
6565
const double dir((tpcgeom.DriftSign() == geo::DriftSign::Negative) ? +1.0 : -1.0);
66-
float x_ticks_coefficient = kDriftVelocity*kTickPeriod;
66+
float x_ticks_coefficient = kDriftVelocity*kTickPeriod;
6767
float goofy_offset = -xyz.X() / (dir * x_ticks_coefficient);
6868
kXTicksOffsets[cstat][tpc][pl] = offset - goofy_offset;
6969
} else {
@@ -156,18 +156,18 @@ namespace blip {
156156
for(int i=0; i<kNplanes; i++) {
157157
if( i == fCaloPlane ) continue;
158158
h_clust_overlap[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_overlap",iTPC,i), Form("TPC %i, Plane %i clusters;Overlap fraction",iTPC,i),101,0,1.01);
159-
h_clust_dt[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_dt",iTPC,i), Form("TPC %i, Plane %i clusters;dT [ticks]",iTPC,i),200,-10,10);
159+
h_clust_dt[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_dt",iTPC,i), Form("TPC %i, Plane %i clusters;dT [ticks]",iTPC,i),200,-10,10);
160160
h_clust_dtfrac[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_dtfrac",iTPC,i), Form("TPC %i, Plane %i clusters;Charge-weighted mean dT/RMS",iTPC,i),150,-1.5,1.5);
161161

162162
h_clust_q[iTPC][i] = hdir.make<TH2D>(Form("t%i_p%i_clust_charge",iTPC,i),
163163
Form("Pre-cut, TPC %i;Plane %i cluster charge [#times10^{3} e-];Plane %i cluster charge [#times10^{3} e-]",iTPC,fCaloPlane,i),
164164
qbins,0,qmax,qbins,0,qmax);
165-
h_clust_q[iTPC][i]->SetOption("colz");
165+
h_clust_q[iTPC][i]->SetOption("colz");
166166

167167
h_clust_q_cut[iTPC][i] = hdir.make<TH2D>(Form("t%i_p%i_clust_charge_cut",iTPC,i),
168168
Form("Post-cut, TPC %i;Plane %i cluster charge [#times10^{3} e-];Plane %i cluster charge [#times10^{3}]",iTPC,fCaloPlane,i),
169169
qbins,0,qmax,qbins,0,qmax);
170-
h_clust_q_cut[iTPC][i]->SetOption("colz");
170+
h_clust_q_cut[iTPC][i]->SetOption("colz");
171171

172172
h_clust_score[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_matchscore",iTPC,i), Form("TPC %i, Plane %i clusters;Match score",iTPC,i),101,0,1.01);
173173

@@ -181,7 +181,7 @@ namespace blip {
181181
h_clust_truematch_q[iTPC][i] = hdir.make<TH2D>(Form("t%i_p%i_clust_truematch_charge",iTPC,i),
182182
Form("Pre-cut, TPC %i;Plane %i cluster charge [#times10^{3} e-];Plane %i cluster charge [#times10^{3} e-]",iTPC,fCaloPlane,i),
183183
qbins,0,qmax,qbins,0,qmax);
184-
h_clust_truematch_q[iTPC][i]->SetOption("colz");
184+
h_clust_truematch_q[iTPC][i]->SetOption("colz");
185185

186186
h_clust_truematch_score[iTPC][i] = hdir.make<TH1D>(Form("t%i_p%i_clust_truematch_matchscore",iTPC,i), Form("TPC %i, Plane %i clusters;Match score",iTPC,i),101,0,1.01);
187187

@@ -932,15 +932,15 @@ namespace blip {
932932
// Check that the two central wires intersect
933933
// *******************************************
934934
double y, z;
935-
geo::Point_t intsec_p;
936-
std::vector<geo::WireID> A_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcA.CenterChan);
937-
std::vector<geo::WireID> B_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcB.CenterChan);
935+
geo::Point_t intsec_p;
936+
std::vector<geo::WireID> A_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcA.CenterChan);
937+
std::vector<geo::WireID> B_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcB.CenterChan);
938938

939-
if( !wireReadoutGeom->Get().WireIDsIntersect(A_wireids.at(0),B_wireids.at(0),intsec_p)) continue;
940-
// Save intersect location, so we don't have to
939+
if( !wireReadoutGeom->Get().WireIDsIntersect(A_wireids.at(0),B_wireids.at(0),intsec_p)) continue;
940+
// Save intersect location, so we don't have to
941941
// make another call to the Geometry service later
942-
y = intsec_p.Y();
943-
z = intsec_p.Z();
942+
y = intsec_p.Y();
943+
z = intsec_p.Z();
944944
TVector3 xloc(0,y,z);
945945
hcA.IntersectLocations[hcB.ID] = xloc;
946946
hcB.IntersectLocations[hcA.ID] = xloc;

sbndcode/BlipRecoSBND/BlipAna_module.cc

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,10 @@ class BlipAnaTreeDataStruct
456456
evtTree->Branch("hit_ismatch",hit_ismatch,"hit_ismatch[nhits]/I");
457457
evtTree->Branch("hit_trkid",hit_trkid,"hit_trkid[nhits]/I");
458458
if( saveTruthInfo ) {
459-
evtTree->Branch("hit_g4trkid",hit_g4trkid,"hit_g4trkid[nhits]/I");
460-
evtTree->Branch("hit_g4frac",hit_g4frac,"hit_g4frac[nhits]/F");
461-
evtTree->Branch("hit_g4energy",hit_g4energy,"hit_g4energy[nhits]/F");
462-
evtTree->Branch("hit_g4charge",hit_g4charge,"hit_g4charge[nhits]/F");
459+
evtTree->Branch("hit_g4trkid",hit_g4trkid,"hit_g4trkid[nhits]/I");
460+
evtTree->Branch("hit_g4frac",hit_g4frac,"hit_g4frac[nhits]/F");
461+
evtTree->Branch("hit_g4energy",hit_g4energy,"hit_g4energy[nhits]/F");
462+
evtTree->Branch("hit_g4charge",hit_g4charge,"hit_g4charge[nhits]/F");
463463
}
464464
evtTree->Branch("hit_clustid",hit_clustid,"hit_clustid[nhits]/I");
465465
evtTree->Branch("hit_blipid",hit_blipid,"hit_blipid[nhits]/I");
@@ -745,22 +745,22 @@ class BlipAna : public art::EDAnalyzer
745745

746746
h_part_process = dir_truth.make<TH1D>("part_process","MCParticle->Process()",5,0,5);
747747
auto xa = h_part_process->GetXaxis();
748-
xa->SetBinLabel(1,"primary");
749-
xa->SetBinLabel(2,"compt");
750-
xa->SetBinLabel(3,"phot");
751-
xa->SetBinLabel(4,"conv");
752-
xa->SetBinLabel(5,"other");
748+
xa->SetBinLabel(1,"primary");
749+
xa->SetBinLabel(2,"compt");
750+
xa->SetBinLabel(3,"phot");
751+
xa->SetBinLabel(4,"conv");
752+
xa->SetBinLabel(5,"other");
753753

754754
h_nblips_tm = dir_truth.make<TH1D>("nblips_tm","Truth-matched 3D blips per event",blipBins,0,blipMax);
755755
h_blip_qcomp = dir_truth.make<TH1D>("blip_qcomp","Fraction of true charge (at anode) reconstructed into 3D blips",202,0,1.01);
756756
h_blip_reszy = dir_truth.make<TH2D>("blip_res_zy","Blip position resolution;Z_{reco} - Z_{true} [cm];Y_{reco} - Y_{true} [cm]",150,-15,15,150,-15,15);
757-
h_blip_reszy ->SetOption("colz");
757+
h_blip_reszy ->SetOption("colz");
758758
h_blip_resx = dir_truth.make<TH1D>("blip_res_x","Blip position resolution;X_{reco} - X_{true} [cm]",200,-10,10);
759759
h_blip_resE = dir_truth.make<TH1D>("blip_res_E","Blip energy resolution;(E_{reco} - E_{true})/E_{true} [cm]",200,-1.,1.);
760760
h_blip_E_vs_resE = dir_truth.make<TH2D>("blip_res_energy","Energy resolution of 3D blips;Energy [MeV];#deltaE/E_{true}",100,0,5,200,-1.,1.);
761-
h_blip_E_vs_resE ->SetOption("colz");
761+
h_blip_E_vs_resE ->SetOption("colz");
762762
h_clust_qres_vs_q = dir_truth.make<TH2D>("qres_vs_q","Clusters on collection plane;True charge deposited [ #times 10^{3} e- ];Reco resolution",160,0,80,200,-1,1);
763-
h_clust_qres_vs_q ->SetOption("colz");
763+
h_clust_qres_vs_q ->SetOption("colz");
764764
h_clust_qres_anode = dir_truth.make<TH1D>("qres_anode","Reco charge vs true charge collected;( reco-true ) / true;Area-normalized entries",200,-1.,1.);
765765
h_clust_qres_dep = dir_truth.make<TH1D>("qres_dep","Reco charge vs true charge deposited;( reco-true ) / true;Area-normalized entries",200,-1.,1.);
766766
h_qratio_vs_time_sim = dir_truth.make<TH2D>("qratio_vs_time_sim",";Drift time [#mus]; Q_{anode} / Q_{dep}",44,100,2300, 1000,0.50,1.50);
@@ -801,10 +801,10 @@ class BlipAna : public art::EDAnalyzer
801801
h_hitqres[i] = dir_truth.make<TH1D>(Form("pl%i_hit_q_res",i), Form("Plane %i hits;charge resolution: (reco-true)/true",i), 400,-1,1);
802802
h_hitqres_scatter[i] = dir_truth.make<TH2D>( Form("pl%i_hit_qres_scatter",i),
803803
Form("Plane %i;true hit charge [#times 10^{3} e-];Reconstructed hit charge [#times 10^{3} e-]",i),qBins,0,qMax/1e3,qBins,0,qMax/1e3);
804-
h_hitqres_scatter[i] ->SetOption("colz");
804+
h_hitqres_scatter[i] ->SetOption("colz");
805805
h_hitqres_vs_q[i] = dir_truth.make<TH2D>( Form("pl%i_hit_qres_vs_q",i),
806806
Form("Plane %i;true hit charge [#times 10^{3} e-];hit charge resolution: (reco-true)/true",i),qBins,0,qMax/1e3, 400,-2,2);
807-
h_hitqres_vs_q[i] ->SetOption("colz");
807+
h_hitqres_vs_q[i] ->SetOption("colz");
808808

809809
h_chargecomp[i] = dir_truth.make<TH1D>(Form("pl%i_hit_charge_completeness",i),Form("charge completness, plane %i",i),101,0,1.01);
810810
h_hitpur[i] = dir_truth.make<TH1D>(Form("pl%i_hit_purity",i),Form("hit purity, plane %i",i),101,0,1.01);
@@ -1385,7 +1385,7 @@ void BlipAna::analyze(const art::Event& evt)
13851385
nblips_picky++;
13861386
fNum3DBlipsPicky++;
13871387
h_blip_charge_picky ->Fill(blp.clusters[fCaloPlane].Charge);
1388-
h_blip_zy_picky ->Fill(blp.Position.Z(), blp.Position.Y());
1388+
h_blip_zy_picky ->Fill(blp.Position.Z(), blp.Position.Y());
13891389
h_blip_charge_YU_picky->Fill( 0.001*blp.clusters[2].Charge, 0.001*blp.clusters[0].Charge );
13901390
h_blip_charge_YV_picky->Fill( 0.001*blp.clusters[2].Charge, 0.001*blp.clusters[1].Charge );
13911391
h_blip_charge_UV_picky->Fill( 0.001*blp.clusters[0].Charge, 0.001*blp.clusters[1].Charge );
@@ -1488,27 +1488,27 @@ void BlipAna::endJob(){
14881488
//printf(" picky frac : %5.3f\n", fNum3DBlipsPicky/float(fNum3DBlips));
14891489

14901490
if(fIsMC){
1491-
printf(" MC-matched blips per evt : %.3f\n", fNum3DBlipsTrue/nEvents);
1492-
printf(" MC blip purity : %.3f\n", fNum3DBlipsTrue/float(fNum3DBlips));
1493-
printf(" MC blip purity, 3 planes : %.3f\n", fNum3DBlipsTrue3P/float(fNum3DBlips3Plane));
1494-
if( h_blip_qcomp->GetMean() > 0 )
1495-
printf(" Charge completeness, total : %.4f +/- %.4f\n", h_blip_qcomp->GetMean(), h_blip_qcomp->GetStdDev()/sqrt(fNumEvents));
1496-
//printf(" < 2MeV : %.4f +/- %.4f\n", h_blip_qcomp_2MeV->GetMean(), h_blip_qcomp_2MeV->GetStdDev()/sqrt(fNumEvents));
1497-
//printf(" Blip purity : %.4f\n", h_blip_pur->GetMean());
1491+
printf(" MC-matched blips per evt : %.3f\n", fNum3DBlipsTrue/nEvents);
1492+
printf(" MC blip purity : %.3f\n", fNum3DBlipsTrue/float(fNum3DBlips));
1493+
printf(" MC blip purity, 3 planes : %.3f\n", fNum3DBlipsTrue3P/float(fNum3DBlips3Plane));
1494+
if( h_blip_qcomp->GetMean() > 0 )
1495+
printf(" Charge completeness, total : %.4f +/- %.4f\n", h_blip_qcomp->GetMean(), h_blip_qcomp->GetStdDev()/sqrt(fNumEvents));
1496+
//printf(" < 2MeV : %.4f +/- %.4f\n", h_blip_qcomp_2MeV->GetMean(), h_blip_qcomp_2MeV->GetStdDev()/sqrt(fNumEvents));
1497+
//printf(" Blip purity : %.4f\n", h_blip_pur->GetMean());
14981498
}
14991499
printf(" Mean blip charge : %.0f e-\n", h_blip_charge->GetMean());
15001500
printf("\n");
15011501
for(size_t i=0; i<kNplanes; i++){
1502-
printf(" Plane %lu -------------------------\n",i);
1503-
printf(" * total hits/evt : %.2f\n",fNumHits[i]/(float)fNumEvents);
1504-
printf(" * untracked hits/evt : %.2f (%.2f plane-matched)\n",fNumHitsUntracked[i]/(float)fNumEvents, fNumHitsMatched[i]/(float)fNumEvents);
1505-
//printf(" * plane-matched hits/evt : %.2f\n",fNumHitsMatched[i]/(float)fNumEvents);
1506-
if(fIsMC) {
1507-
printf(" * true-matched hits/evt : %.2f (%.2f plane-matched)\n",fNumHitsTrue[i]/(float)fNumEvents, fNumHitsMatchedTrue[i]/(float)fNumEvents);
1508-
if( h_chargecomp[i]->GetMean() > 0 )
1509-
printf(" * charge completeness : %.4f\n",h_chargecomp[i]->GetMean());
1510-
printf(" * hit purity : %.4f\n",h_hitpur[i]->GetMean());
1511-
}
1502+
printf(" Plane %lu -------------------------\n",i);
1503+
printf(" * total hits/evt : %.2f\n",fNumHits[i]/(float)fNumEvents);
1504+
printf(" * untracked hits/evt : %.2f (%.2f plane-matched)\n",fNumHitsUntracked[i]/(float)fNumEvents, fNumHitsMatched[i]/(float)fNumEvents);
1505+
//printf(" * plane-matched hits/evt : %.2f\n",fNumHitsMatched[i]/(float)fNumEvents);
1506+
if(fIsMC) {
1507+
printf(" * true-matched hits/evt : %.2f (%.2f plane-matched)\n",fNumHitsTrue[i]/(float)fNumEvents, fNumHitsMatchedTrue[i]/(float)fNumEvents);
1508+
if( h_chargecomp[i]->GetMean() > 0 )
1509+
printf(" * charge completeness : %.4f\n",h_chargecomp[i]->GetMean());
1510+
printf(" * hit purity : %.4f\n",h_hitpur[i]->GetMean());
1511+
}
15121512
}
15131513
printf("\n***********************************************\n");
15141514

sbndcode/BlipRecoSBND/Utils/BlipUtils.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ void FillParticleInfo( const simb::MCParticle& part, blip::ParticleInfo& pinfo,
395395
// use view with the maximal wire extent to calculate transverse (YZ) length
396396
if( hcs[i].NWires > newblip.MaxWireSpan ) {
397397
newblip.MaxWireSpan = hcs[i].NWires;
398-
newblip.dYZ = hcs[i].NWires * wirepitch;
398+
newblip.dYZ = hcs[i].NWires * wirepitch;
399399
}
400400

401401
for(size_t j=i+1; j<hcs.size(); j++){
@@ -409,9 +409,8 @@ void FillParticleInfo( const simb::MCParticle& part, blip::ParticleInfo& pinfo,
409409
intsec_p.SetY(hcs[i].IntersectLocations.find(hcs[j].ID)->second.Y());
410410
intsec_p.SetZ(hcs[i].IntersectLocations.find(hcs[j].ID)->second.Z());
411411
} else {
412-
std::vector<geo::WireID> i_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcs[i].CenterChan);
413-
std::vector<geo::WireID> j_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcs[j].CenterChan);
414-
412+
std::vector<geo::WireID> i_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcs[i].CenterChan);
413+
std::vector<geo::WireID> j_wireids = wireReadoutGeom->Get().ChannelToWire((unsigned int)hcs[j].CenterChan);
415414
match3d = wireReadoutGeom->Get().WireIDsIntersect(i_wireids.at(0), j_wireids.at(0), intsec_p);
416415
}
417416

0 commit comments

Comments
 (0)