You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-4
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,18 @@ scram b -j 8
33
33
<li> <strong>plugins/</strong>: which contains the plugins (EDAnalyzer's) where the analyzers are defined in .cc files. These are the main code.</li>
34
34
<li> <strong>python/</strong>: which contains cfi files to setup the sequences that run with the plugins contained in plugins/. A sequence is an specific configuration of the parameters that run with one of the plugins defined in plugins. One single plugin may have different sequences defined in the same or multiple files.</li>
35
35
<li> <strong>test/</strong>: which contains cfg files to run the sequences defined in the python/ folder.</li>
36
+
<li> <strong>macros/</strong> (optional): which contains .py files to read the produced ntuples and create the plots if we don't have an external analyzer.</li>
36
37
</ul>
37
38
38
39
### EDAnalyzer plugin
39
40
40
-
(to be completed)
41
+
EDAnalyzer is a class that is designed to loop over the events of one or several ROOT files. It has several actions that are executed before the event loop in the ```beginJob()``` function, actions that are executed per event in the ```analyze()``` function and actions that are executed once the loop has finished in the ```endJob()``` function.
42
+
43
+
Each EDAnalyzer instance is associated with a module (don't forget to include this line):
In the case of the ntuplizer we would like to initialize the output file in the ```beginJob()``` function, fill the information per event in the ```analyze()``` function and finally close and save the file in the ```analyze()``` once all the information is saved.
The configurarion cfg file serves to run the plugins as described in Section "How to run".
77
+
69
78
## How to run
70
79
71
80
This example runs with a file of the 2023 NoBPTX dataset that may need to be accessed throught xrootd. Make sure that you have a valid proxy before running and do at least once:
@@ -85,9 +94,6 @@ cmsRun test/runNtuplizer_cfg.py
85
94
86
95
In this section (to be completed) there are several examples of how modify the existing analyzer.
87
96
88
-
### How to add a parameter
89
-
90
-
91
97
### How to add new variables of an existing collection
92
98
93
99
1) We first need to declare a new variable that will act as a container for the value we want to store e.g. the number of displacedGlobalMuon tracks ```ndgl```. It is defined in the constructor of the EDAnalyzer as a private variable (although it could be also a global variable):
To read collections we need to know the class of the objects we want to access and the label of the collection itself. If you don't know this information this command is useful:
For example, to access displaced muons in MiniAOD we need to know that the name of the collection is ```slimmedDisplacedMuons``` and that these are saved as ```pat::Muon``` objects.
126
+
127
+
Then, we need to define a Token and a Handler in the EDAnalyzer declaration as private variables:
0 commit comments