Repository navigation
Conversation
|
This PR is part of a set of 4 in sbndcode, sbnobj, sbncode, and sbnanaobj to make this new blip data entry, and share it to CAF level. |
|
Initial checks on MC looked good. The values of energy were very mildly shifted with temporary debug print outs like Unfortunately the detector properties service used to get the electron lifetime initially applies a fixed lifetime. We will need to connect to some kind of calibration database service to get better results on data. |
…ol easier to import
|
This PR is more complicated. This PR does not interrupt PANDORA's use of the NormalizeDriftSQLite_tool and allows blips to use NormalizeDriftSQLite_class. If we have an example of implementation of the art_tool version (that doesn't result in the code duplication seen in sbndcode/sbndcode/Calorimetry/LightCaloProducer_module.cc Lines 821 to 848 in 27d88f5 |
|
Oh oops let me get rid of the print statements I used to check the implementation. |
|
I have verified this code imports the correct lifetime values and adds additional variables to the blip larsoft output (reco2) and SRBlip output (CAF). |
|
I need to include normalizeDrift settings in the blipconfig.fcl (never pushed those changes) |
…n' into feature/BlipEnergyDriftCorrection
PetrilloAtWork
left a comment
There was a problem hiding this comment.
Left a few comments. I am particularly confused by the pattern of the tool source code.
However, I bear no authority on sbndcode, so mine should be taken just as suggestions.
| fCylinderRadius = pset.get<float> ("CylinderRadius", 15); | ||
|
|
||
| fCaloAlg = new calo::CalorimetryAlg( pset.get<fhicl::ParameterSet>("CaloAlg") ); | ||
| ElifetimeTool = new sbnd::calo::NormalizeDriftSQLite( pset.get<fhicl::ParameterSet>("NormalizeDrift")); |
There was a problem hiding this comment.
I recommend the use of std::unique_ptr here ([CF-051]). In shared SBN code, we forbid the use of new/delete, but this is not SBN code so it's up to you (I would change also the calo algorithm, rather than abiding to its questionable example).
Actually, I would go directly with an object in the class: I currently don't see a reason to allocate it dynamically; but that has also to do with a plan of future extension to other implementations.
| float Efield = kNominalEfield; | ||
|
|
||
| float recomb = ModBoxRecomb(fCalodEdx,Efield); | ||
| blip.EnergyNoDriftCorrection = depEl * (1./recomb) * kWion; |
There was a problem hiding this comment.
Why not just
| blip.EnergyNoDriftCorrection = depEl * (1./recomb) * kWion; | |
| blip.EnergyNoDriftCorrection = depEl / recomb * kWion; |
?
No big deal, but it feels strange.
There was a problem hiding this comment.
Thats a good point. This exact syntax predates me, but happy to simplify the line.
| float energy_estar = Q_to_E_ESTAR(depEl); | ||
| float energy_pstar = Q_to_E_PSTAR(depEl); | ||
| blip.EnergyESTARNoDriftCorrection = energy_estar; | ||
| blip.EnergyPSTARNoDriftCorrection = energy_pstar; |
There was a problem hiding this comment.
It does not look like you really need that temporary parking spot any more:
| float energy_estar = Q_to_E_ESTAR(depEl); | |
| float energy_pstar = Q_to_E_PSTAR(depEl); | |
| blip.EnergyESTARNoDriftCorrection = energy_estar; | |
| blip.EnergyPSTARNoDriftCorrection = energy_pstar; | |
| blip.EnergyESTARNoDriftCorrection = Q_to_E_ESTAR(depEl); | |
| blip.EnergyPSTARNoDriftCorrection = Q_to_E_PSTAR(depEl)r; |
There was a problem hiding this comment.
Removed both instances of this parking
| energy_estar = Q_to_E_ESTAR(depEl); | ||
| energy_pstar = Q_to_E_PSTAR(depEl); //reaculate after drift correction | ||
| blip.EnergyESTAR = energy_estar; | ||
| blip.EnergyPSTAR = energy_pstar; |
There was a problem hiding this comment.
| energy_estar = Q_to_E_ESTAR(depEl); | |
| energy_pstar = Q_to_E_PSTAR(depEl); //reaculate after drift correction | |
| blip.EnergyESTAR = energy_estar; | |
| blip.EnergyPSTAR = energy_pstar; | |
| blip.EnergyESTAR = Q_to_E_ESTAR(depEl); | |
| blip.EnergyPSTAR = Q_to_E_PSTAR(depEl); //recalculate after drift correction |
| cet_build_plugin(NormalizeDriftSQLite art::tool LIBRARIES ${TOOL_LIBRARIES}) | ||
| cet_build_plugin(NormalizeYZ art::tool LIBRARIES ${TOOL_LIBRARIES}) | ||
|
|
||
| cet_make_library(LIBRARY_NAME sbndcode_GIMME_LIFETIMES |
There was a problem hiding this comment.
While GIMME_LIFETIMES is indeed pretty straightforward and self-describing, it may complicate users' lifetime. At a certain point, from other code or from the documentation, I find out that I need the class sbnd::calo::NormalizeDriftSQLite, and I need to add its library. Normally what I would do is to look for sbndcode::NormalizeDriftSQLite or sbndcode::Calibration/TPCCalorimetry or sbndcode::Calibration/TPCCalorimetry/NormalizeDriftSQLite, but I will never guess GIMME_LIFETIMES.
There was a problem hiding this comment.
Whoops. I was having trouble getting the cmake sorted and gave myself a really obvious name for printing. I'll update to sbndcode::Calibration/TPCCalorimetry/NormalizeDriftSQLite
|
Responded to the comments. I'll test the area again, and then need to pull the changes into the production branch PR |
|
Code output looks good after above fixes. I will get these rolled into the related production PR |
|
All four of these related PR should be ready to merge now. |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
One last requests on the library name, to avoid slashes.
| cet_build_plugin(NormalizeDriftSQLite art::tool LIBRARIES ${TOOL_LIBRARIES}) | ||
| cet_build_plugin(NormalizeYZ art::tool LIBRARIES ${TOOL_LIBRARIES}) | ||
| cet_make_library(LIBRARY_NAME sbndcode_GIMME_LIFETIMES | ||
| cet_make_library(LIBRARY_NAME sbndcode::Calibration/TPCCalorimetry/NormalizeDriftSQLite |
There was a problem hiding this comment.
Sorry to bother you again... I am not sure what may happen with slashes (/) in the library target names. The standard practice here is ti use underscores:
| cet_make_library(LIBRARY_NAME sbndcode::Calibration/TPCCalorimetry/NormalizeDriftSQLite | |
| cet_make_library(LIBRARY_NAME sbndcode::Calibration_TPCCalorimetry_NormalizeDriftSQLite |
There was a problem hiding this comment.
Hi @Jjm321814. It looks like you have this addressed in the gen2 production version already. Can you update this for the develop version?
There was a problem hiding this comment.
This has been addressed as well
Co-authored-by: Gianluca Petrillo <petrillo@slac.stanford.edu>
|
Brought this up to date with develop and verified I had cleaned up the include statements. |
Adding additional blip energy variables so analyzers have access to a drift corrected energy, as well as an explicitly not drift corrected one.
All drift corrections are anchored to the event timestamp, so the beam blips will come out with the right energy. Any out-of-time blip activity will be mis-corrected, so the noDriftCorrection variables are saved as new variables.