|
| 1 | +# Running the pepr PF candidate producer for HGCAL |
| 2 | + |
| 3 | +This example demonstrates how to run the particle reconstruction in the HGCAL subdetector via inference of graph neural networks. |
| 4 | + |
| 5 | +## Setup |
| 6 | + |
| 7 | +Install CMSSW: |
| 8 | +``` |
| 9 | +export SCRAM_ARCH="slc7_amd64_gcc820" |
| 10 | +cmsrel CMSSW_11_1_0_pre7 |
| 11 | +cd CMSSW_11_1_0_pre7/src |
| 12 | +cmsenv |
| 13 | +scram b -j 8 |
| 14 | +``` |
| 15 | + |
| 16 | +Install custom packages: |
| 17 | +``` |
| 18 | +git cms-init |
| 19 | +git cms-merge-topic cms-pepr:pepr_CMSSW_11_1_0_pre7 |
| 20 | +scram b -j 8 |
| 21 | +``` |
| 22 | + |
| 23 | +## Generate events |
| 24 | + |
| 25 | +First we produce GEN-SIM-DIGI (GSD) events, in this example by shooting particles (e.g. photons) |
| 26 | +in a certain energy range towards the HGCAL subdetector via the `FlatEtaRangeGunProducer`. |
| 27 | +``` |
| 28 | +cd RecoHGCal/GraphReco/test |
| 29 | +cmsRun GSD_GUN.py seed=1 outputFile="file:1_GSD.root" maxEvents=5 |
| 30 | +``` |
| 31 | +Once the GSD events are produced, we can run the reconstruction step: |
| 32 | +``` |
| 33 | +cmsRun RECO_pf.py inputFiles="file://1_GSD.root" outputFile="file:1_RECO.root" outputFileDQM="file:1_DQM.root" maxEvents=5 |
| 34 | +``` |
| 35 | +A dedicated **EDProducer module**, the `peprCandidateFromHitProducer` located |
| 36 | +in the [RecoHGCAL/GraphReco](https://github.com/gvonsem/cmssw/tree/pepr_CMSSW_11_1_0_pre7_peprCandDev/RecoHGCal/GraphReco) package, |
| 37 | +produces PF candidates straight from rechit information, in this example via the [Object Condensation](https://arxiv.org/abs/2002.03605v3) method. |
| 38 | +The inference of trained graph neural network models is done by sending the rechit information per endcap to a custom Triton server, evaluating the model, |
| 39 | +and retrieving the regressed energy and position of clustered particle candidates. |
| 40 | +These candidates are subsequently turned into a PFcandidate collection named `recoPFCandidates_peprCandidateFromHitProducer__RECO`. Particle and charge identification as well as track-cluster matching are work in progress and not included yet. |
| 41 | + |
| 42 | +**Note:** it may take some time for the event loop in the reconstruction to start, and inference may be slow on a CPU server. The speed of communication with the client and especially the inference will improve drastically once dedicated Triton GPU servers are used. |
| 43 | + |
| 44 | +The **sequence** of the producer module is as follows: |
| 45 | +* In the constructor of the producer, the Triton client is started. |
| 46 | +* The producer checks for open pipes (set up to communicate with the Triton server) and will wait until the pipes are open to send the rechit data to the server. |
| 47 | +* In case the pipes are open before the producer reaches the check, the client will wait until the rechit data is passed from the producer. |
| 48 | +* The inference itself is done on the Triton server via the trained model that is stored there, and the results are passed back to the module where a collection of reconstructed particle candidates is created. |
| 49 | +* The Triton client is automatically closed in the destructor of the producer |
| 50 | + |
| 51 | + |
0 commit comments