If one wishes to use the caf_trigger package for ones trigger studies, one must first retrieve the package from the CVS repository.
> setup d0cvs
> cvs checkout caf_trigger version-tag
Of course, one may have already retrieved the package in this fashion. In this case, one will be guided throughout this documentation upon the features and methods available.
One must also retrieve the eff_utils package.
CAFe runs on processors, and processors are run through a config file. Documentation on the config files shall follow this, but first, lets allow oneself to be familiar with the flow of the running processors.
The process flow shown relates to the common situation where the user may use more than one plug-between processor.
One would be wondering at this time, what use one would find with these processors and how one would use such a framework. One must first be introduced to these processors, and one would begin with the cafTriggerEfficiency processor.
This processor is the initializer. When one places a probability processor after this processor in the flow, one will be passed various quantities for ones calculations.
This is where one would find the heart of ones combinatorical calculations. This is a flexible area and I shall provide some examples of how one could use or create such processors.
This is the final piece of the processor chain and a crucial component in the framework. The following is performed by this processor:
This concludes the package framework. As one can see, it has a simple flow to it. The workings of a probability processor shall be delved into in detail in a later section, as well as actually running the package.
All CAFe packages are run in the same fashion; The main executable "cafe" is run and usually it is run with a config file of some sort. The config file allows one to input changes on run-time, much like a command line executable but on a much larger scale. One should have a look at the following config file for a detailed example.
The following is known as probmuw_w_l2m3_trk10.config. It is run using the command: cafe probmuw_w_l2m3_trk10.config. The outputs go to the file d0evtwt.root as histograms. All lines beginning with "#" are comments and have no affect on the execution of the config file. All of the config files I've used are available in the examples/ folder.
#The main run command. It runs 4 groups of processors in a chain. It draws a histogram before any probabilities are calculated, calculates the event weights for a signal channel, then draws 3 histograms with these event weights. One without any sigma variations, one with +1 sigma variation and one with -1 sigma variation.
cafe.Run: Group(Hist1DBefore),Group(mycaftrig),Group(Hist1DAfter),Group(Hist1DAftersig1),Group(Hist1DAftersig2)
#This section is another staple of CAFe where one would state the package one intends to use, the input file of interest, and finally the output file for any outputs from any processors that will be run. Note that the eff_utils package is required for this to run.
cafe.Packages: eff_utils caf_trigger
cafe.Input: d0tmba_p18.01.00_zmumu_reco_tsim_mc.root
cafe.Output: d0evtwt.root
#This chunk is the portion of the config file pertinent to caf_trigger itself and not any other processors. One should pay attention to the detailed explanation of each line.
#This .Run: command, chains together 3 of our processors. The initialization, the probability processor of interest and the output processor.
mycaftrig.Run: cafTriggerEfficiency(mycaftrig),Group(Muw_w_l2m3_trk10),cafTriggerOutput(mycaftrig)
#The next 3 options allow one to choose the branch in the caf file tree that one wishes to use.
mycaftrig.embranch: EMscone
mycaftrig.mubranch: Muons
mycaftrig.jetbranch: JCCA
#The lumi and triglist options set the luminosity weights for each triggerlist. Note: If one has v11, v13, v14 listed, then under lumi, the first number will correspond to v11, the second to v13, and the third to v14
mycaftrig.lumi: 11.,35.,50.
mycaftrig.triglist: v11,v12,v13
#This sets the output of the event weight in a histogram which ranges from 0 to 1. histosBins sets the number of bins of that histogram. The histogram will be placed in the cafe.Output file. Note that for the .histos: option, one would select the channel names defined for each level.
mycaftrig.histos: Muw_w_l2m3_trk10_L1,Muw_w_l2m3_trk10_L2,Muw_w_l2m3_trk10_L3
mycaftrig.histosBins: 50
#This flag turns on the +1, -1 sigma calculations. If one does not require the sigma calculations, one should set this flag to false as they are computationally intensive.
mycaftrig.sigma: true
#Specifies the channel to put into the event as "_globalWeightKey". This is a float put into the event of the event weight under the stated key. Processors before and after caf_trigger can send an event weight for caf_trigger to multiply with, or grab an event weight to use after caf_trigger. We will submit the combined L1, L2, and L3 probabilities here to the next processors that may wish to use it.
mycaftrig.globalWeight: Muw_w_l2m3_trk10_combine
#This is the Muw_w_l2m3_trk10 group defined earlier. It defines the 3 processors for each level, and the combination processor in the correct order. Order is important!
Muw_w_l2m3_trk10.Run: probMuw_w_l2m3_trk10_L1(Muw_w_l2m3_trk10),probMuw_w_l2m3_trk10_L2(Muw_w_l2m3_trk10),probMuw_w_l2m3_trk10_L3(Muw_w_l2m3_trk10),probMuw_w_l2m3_trk10_combine(Muw_w_l2m3_trk10)
#Here is where one would choose which levels one would wish to combine. One may combine (L1, L2), (L1, L3), (L2, L3) or (L1, L2, L3).
Muw_w_l2m3_trk10.combine: Muw_w_l2m3_trk10_L1,Muw_w_l2m3_trk10_L2,Muw_w_l2m3_trk10_L3
#This is where we tell the processors that yes, we would like the sigma calculations to be done.
Muw_w_l2m3_trk10.sigma: true
#This is the first group in cafe.Run. It configures the users chosen histogram, which in this case is Muon.Pt()
Hist1DBefore.Run: Hist1D(Hist1DBefore)
Hist1DBefore.Title: "Muon.pt before"
Hist1DBefore.Bins: 50 0.0 100.0
Hist1DBefore.Draw: Muon.Pt()
Hist1DBefore.Weight: 1.0
#This is the first group after caf_trigger in cafe.Run. It configures a histogram of Muon.Pt(), weighting each event with the event weight given by caf_trigger. The weight is named caf_triggerWeight channel.
Hist1DAfter.Run: Hist1D(Hist1DAfter)
Hist1DAfter.Title: "Muon.pt after"
Hist1DAfter.Bins: 50 0.0 100.0
Hist1DAfter.Draw: Muon.Pt()
Hist1DAfter.Weight: caf_triggerWeight Muw_w_l2m3_trk10_combine
#This is one of the groups after caf_trigger in cafe.Run. It configures a histogram of Muon.Pt(), weighting each event with the event weight sigma +1 given by caf_trigger. One must set .sigma: true for this to be available. The weight is named caf_triggerWeight channel Sigmas: 1.
Hist1DAftersig1.Run: Hist1D(Hist1DAftersig1)
Hist1DAftersig1.Title: "Muon.pt after Sigma +1"
Hist1DAftersig1.Bins: 50 0.0 100.0
Hist1DAftersig1.Draw: Muon.Pt()
Hist1DAftersig1.Weight: caf_triggerWeight Muw_w_l2m3_trk10_combine Sigmas: 1
#This is one of the groups after caf_trigger in cafe.Run. It configures a histogram of Muon.Pt(), weighting each event with the event weight sigma -1 given by caf_trigger. One must set .sigma: true for this to be available. The weight is named caf_triggerWeight channel Sigmas: -1.
Hist1DAftersig2.Run: Hist1D(Hist1DAftersig2)
Hist1DAftersig2.Title: "Muon.pt after Sigma -1"
Hist1DAftersig2.Bins: 50 0.0 100.0
Hist1DAftersig2.Draw: Muon.Pt()
Hist1DAftersig2.Weight: caf_triggerWeight Muw_w_l2m3_trk10_combine Sigmas: -1
Now, after one executes cafe histo.config, one will recieve as output the event weights on ones terminal window in plain text. One will also find that the output file is filled with histograms. With these histograms, one may create a final histogram showing all of the pertinent information as shown below.
Z->ee Monte-Carlo, weighted with the top group's choice of the electron channel (L3, EM_OR), for 1 object of N, passing the trigger.
Of course, for our MUW_W_L2M3_TRK10 trigger, the outputs are shown at this link [link]
The explanation above pertains to the basic running of the package with a single processor but it shows the flexibility of the package. One may also chain packages together provided that the other packages use _globalWeightKey as the key for the event weight.
cafe.Run: Group(Hist1DBefore),Group(mybtag),Group(mycaftrig),Group(myothereventweightcalculator),Group(Hist1DAfter)
In the fake sequence above, caf_trigger would be passed an event weight from a b-tagging package, which it multiplies with its own event weight. It may then pass this event weight to another package to do with it as it pleases before finally outputting to another histogram processor.
There are a few probability processors that one may use as an example, but for the purposes of creation, one has the option of using the processor probTemplate. The main files of probTemplate are,
+Plugin.Processor: probSignalChannel probSignalChannel caf_trigger "probSignalChannel(const char *)"
What about the processor itself? Where does one place ones code within this framework? Let's look at the two main files where one must place their code.
One may find perfect examples of ways to create ones probability processor by looking to the existing processors that are included in this package. The best example would be the one we have looked at here. probmuw_w_l2m3_trk10_L1, probmuw_w_l2m3_trk10_L2, probmuw_w_l2m3_trk10_L3, and probmuw_w_l2m3_trk10_combine.