Skip to content

Commit a82ac50

Browse files
Merge branch 'develop' into feature/acastill_deconvolution_database
2 parents e44159f + 9200422 commit a82ac50

47 files changed

Lines changed: 621 additions & 1485 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

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

2222
# for CI:
23-
# project(sbndcode VERSION 10.04.03)
23+
# project(sbndcode VERSION 10.04.05)
2424

2525
message(STATUS "\n")
2626
message(STATUS "================================= ${PROJECT_NAME} =================================")

sbndcode/CRT/CRTAna/CRTAnalysis_module.cc

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,6 @@ void sbnd::crt::CRTAnalysis::AnalyseCRTClusters(const art::Event &e, const std::
11461146
_cl_sp_ets1.resize(nClusters);
11471147
_cl_sp_complete.resize(nClusters);
11481148

1149-
art::ServiceHandle<SBND::CRTChannelMapService> ChannelMapService;
1150-
11511149
for(unsigned i = 0; i < nClusters; ++i)
11521150
{
11531151
const auto cluster = CRTClusterVec[i];
@@ -1176,34 +1174,41 @@ void sbnd::crt::CRTAnalysis::AnalyseCRTClusters(const art::Event &e, const std::
11761174
_cl_channel_set[i][ii] = striphit->Channel();
11771175
_cl_adc_set[i][2*ii] = striphit->ADC1();
11781176
_cl_adc_set[i][2*ii+1] = striphit->ADC2();
1179-
_cl_sh_ts0_set[i][ii] = striphit->Ts0();
1180-
_cl_sh_ts1_set[i][ii] = striphit->Ts1();
1181-
SBND::CRTChannelMapService::ModuleInfo_t module_info = ChannelMapService->GetModuleInfoFromOfflineID( striphit->Channel() / 32 );
1182-
_cl_sh_feb_mac5_set[i][ii] = ( module_info.valid ) ? module_info.feb_mac5 : 0;
1183-
1184-
/*
1185-
* The below segment reimplements the CorrectTime() method
1186-
* from CRTReco/CRTClusterCharacterisationAlg.cc .
1187-
* Because the Ts0(), Ts1() getters invoked in _cl_sp_ts*, _cl_sh_ts*_set are raw T0/1
1188-
* counters, the time walk and propagation delay are saved as explicit branches here.
1189-
*/
1190-
if(spacepoints.size() == 1) { // need unique position of spacepoint
1191-
double pe0 = fCRTGeoAlg.GetSiPM( striphit->Channel() ).gain * striphit->ADC1();
1192-
double pe1 = fCRTGeoAlg.GetSiPM( striphit->Channel() + 1 ).gain * striphit->ADC2();
1193-
double pe = pe0 + pe1;
1194-
1195-
double dist = fCRTGeoAlg.DistanceDownStrip( spacepoints[0]->Pos(), striphit->Channel() );
1196-
1197-
double corr = std::pow( dist - fPEAttenuation, 2.0 ) / std::pow( fPEAttenuation, 2.0 );
1198-
double tw_pe = pe * corr;
1199-
1200-
_cl_sh_time_walk_set[i][ii] = fTimeWalkNorm * std::exp( -fTimeWalkScale * tw_pe );
1201-
_cl_sh_prop_delay_set[i][ii] = fPropDelay * dist;
1202-
1203-
} else { // fill with nonsense
1204-
_cl_sh_time_walk_set[i][ii] = -999999.;
1205-
_cl_sh_prop_delay_set[i][ii] = -999999.;
1206-
}
1177+
_cl_sh_ts0_set[i][ii] = striphit->Ts0();
1178+
_cl_sh_ts1_set[i][ii] = striphit->Ts1();
1179+
1180+
if(fDataMode)
1181+
{
1182+
art::ServiceHandle<SBND::CRTChannelMapService> ChannelMapService;
1183+
SBND::CRTChannelMapService::ModuleInfo_t module_info = ChannelMapService->GetModuleInfoFromOfflineID( striphit->Channel() / 32 );
1184+
_cl_sh_feb_mac5_set[i][ii] = ( module_info.valid ) ? module_info.feb_mac5 : 0;
1185+
}
1186+
else
1187+
_cl_sh_feb_mac5_set[i][ii] = striphit->Channel() / 32;
1188+
1189+
/*
1190+
* The below segment reimplements the CorrectTime() method
1191+
* from CRTReco/CRTClusterCharacterisationAlg.cc .
1192+
* Because the Ts0(), Ts1() getters invoked in _cl_sp_ts*, _cl_sh_ts*_set are raw T0/1
1193+
* counters, the time walk and propagation delay are saved as explicit branches here.
1194+
*/
1195+
if(spacepoints.size() == 1) { // need unique position of spacepoint
1196+
double pe0 = fCRTGeoAlg.GetSiPM( striphit->Channel() ).gain * striphit->ADC1();
1197+
double pe1 = fCRTGeoAlg.GetSiPM( striphit->Channel() + 1 ).gain * striphit->ADC2();
1198+
double pe = pe0 + pe1;
1199+
1200+
double dist = fCRTGeoAlg.DistanceDownStrip( spacepoints[0]->Pos(), striphit->Channel() );
1201+
1202+
double corr = std::pow( dist - fPEAttenuation, 2.0 ) / std::pow( fPEAttenuation, 2.0 );
1203+
double tw_pe = pe * corr;
1204+
1205+
_cl_sh_time_walk_set[i][ii] = fTimeWalkNorm * std::exp( -fTimeWalkScale * tw_pe );
1206+
_cl_sh_prop_delay_set[i][ii] = fPropDelay * dist;
1207+
1208+
} else { // fill with nonsense
1209+
_cl_sh_time_walk_set[i][ii] = -999999.;
1210+
_cl_sh_prop_delay_set[i][ii] = -999999.;
1211+
}
12071212

12081213
}
12091214

0 commit comments

Comments
 (0)