svn co svn+ssh://svn.cern.ch/reps/atlasphys-hsg8/Physics/Higgs/HSG8/AnalysisCode/multileptons/xAOD/HTopMultilepAnalysis/tags/HTopMultilepAnalysis-XX-YY-ZZ HTopMultilepAnalysis
svn co svn+ssh://svn.cern.ch/reps/atlasinst/Institutes/UChicago/xAODAnaHelpers/tags/xAODAnaHelpers-XX-YY-ZZ xAODAnaHelpers
rcSetup Base,2.X.Y(remember to do this every time you log in. If you don't plan to change the release, just source the rcSetup.sh script that will be automatically created after the first time you set up ASG)
python xAODAnaHelpers/scripts/checkoutASGtags.py 2.X.Y
rc find_packages rc compile
ln -s HTopMultilepAnalysis /scripts .Have a look at the content of the scripts/ folder:
submit-grid-HTopMultilep.sh submit-grid-singleDS-HTopMultilep.sh submit-local-HTopMultilep.sh submit-lxbatch-HTopMultilep.shThese bash scripts contain just the shell command sequence that is used to run the job steering macro on the various drivers (local, grid ...). As an example, let's see how to submit a local job for the main HTopMultilepAnalyis, running on a single dataset:
test-HTopMultilep --inDSType INDSTYPE --inDir /PATH/TO/DIR/CONTAINING/DATASET/ --inDSName DATASETFOLDER --outDir OUTDIR --maxEvents N
test-HTopMultilep --help
localSetupDQ2Client voms-proxy-init -voms atlas localSetupPandaClient currentJedi --noAthenaCheckOnly after doing this, setup the ASG release and compile (see instructions above). A typical submission command would be something like:
test-{ANALYSISALGO} --outDir OUTDIR --grid 1 -gridUser GRIDUSERNAME --inGridDSList HTopMultilepAnalysis /doc/{YOURSAMPLELIST}.txt --inDSType INDSTYPE --outDSID GRIDOUTDSIDENTIFIERHave a look into the doc/ folder to see how a sample list file looks like. The GRIDOUTDSIDENTIFIER is a name of your choice that will uniquely identify the output datasets of your grid job. When you issue the above command, you will be prompted to confirm the output DS identifier. If you say "yes", then the submission will start (usually takes a bit of time, depending on how many samples you are processing). Inside the steering macro, it's possible to configure the grid job using EventLoop metadata system (see here for a list of options), as much as you would do with prun.
Algorithm | Description |
---|---|
HTopMultilepEventSelector.cxx | An algorithm that applies an event selection. At the moment, the user can apply a cut based on ( minimum number of leptons (muons + electrons) OR minimum number of leptons and taus ) and on the minimum number of bjets. NB: At this stage, the muons and electrons are combined into a "Leptons_Sel" xAOD custom container, which is then used by all the algorithms downstream. |
TruthMatchAlgo.cxx | An algorithm that applies truth matching to the reconstructed objects, and decorates them with info about the truth type and origin, as well as info for charge flipped leptons.
TruthMatchAlgo::applyTruthMatchingDC14( ) Default algorithm for truth matching on DC14 samples. TruthMatchAlgo::applyTruthMatchingMuonMC15() TruthMatchAlgo::applyTruthMatchingElectronMC15() These will be the default algorithms for MC 15. They take advantage of the already stored info on the xAOD::Electron objects ( i.e., truthType and truthOrigin of the truth particle that has been found matching this electron at reconstruction level ). For the Muon objects, still need to pass through the "MuonTruthParticles" truth xAOD container and do a track-matching. |
HTopMultilepAnalysis.cxx | The main ttH analysis algorithm. It retrieves manipulated objects from the xAH algos upstream, and applies analysis-specific event selection and categorisation.
HTopMultilepAnalysis::addChannelDecorations() A method used to decorate event and lepton objects with specific attributes used afterwards for category definitions. These custom attributes are also crucial for the subsequent calculation of the MM weights. HTopMultilepAnalysis::fakeWeightCalculator() A method that calculates the Matrix Method weights for the fake lepton background estimation. Real/fake rates are manually plugged in at the moment. For the future: read the "baseline" rates from an external ROOT file.
HTopMultilepAnalysis::applyTagAndProbeRFRateMeasurement() A method that performs a selection for real and fake-enriched CRs (low jet multiplicity, OS and SS respectively), and then defines "Tag&Probe" leptons. The probe in each CR (OS, SS) is used to derive the rates offline, by taking the ratio ( N. probe Tight / N. probe Tight ) binned in pT and eta |
HTopMultlepTree.cxx | This is where the user defines the custom TTree branches to be dumped in the ntuple. They get filled by either accessing primitive attributes of the objects ( pt, d0sig,...) or by accessing decorations of the objects themselves (e.g., isTight, ... ) |
HTopMultilepTreeAlgo.cxx | An EL::algo managing the TTree writing. This is the one which gets instantiated and configured by the user.
Via configuration, the user can decide whether to dump or not some basic sets of branches for the event/object collections defined in xAH HelpTreeBase algo (e.g., basic kinematic variables for electrons, electron track parameters, etc. ). The custom branches defined in HTopMultilepTree will be fully dumped instead. |
HTopMultilepAnalysis/data/Tree/tree_HTopMultilep_DxAOD-DC14-8TeV.configspecifically at the lines:
EventDetailStr "pileup" MuonDetailStr "kinematic trackparams trackhitcont" ...The available strings to decide the sets of output branches for each "object" are defined in:
xAODAnaHelpers/trunk/Root/HelperClasses.cxxin the :
{MY-OBJECT}InfoSwitch::initialize()methods. Beware that these will affect only the "basic" branches defined in the tree base class:
xAODAnaHelpers/trunk/Root/HelpTreeBase.cxx(these are branches that will most likely be used by any analysis). At this stage, I haven't implemented such a thing for the branches defined in the HTopMultilepTree.h derived class, but can be easily done if needed.
HTopMultilepAnalysis/util/test-HTopMultilep.cxxHTopMultilepAnalysis/util/test-HTopMultilepAnalysis.cxx( the other *.cxx in the util/ folder are just simple test macros used for debugging. Still, they are a perfect testing ground if you just want to play around with the xAOD EDM
Event/Muons/Electrons/Jets/Tracks/OverlapRemoval/Analysis/Tree/The name of the config files themselves, and the lines where flags/thresholds/WPs are set should be pretty straightforward to understand. A few words on the:
InputContainer MyContainer_INOutputContainer MyContainer_OUTlines. The MyContainer_IN must be the name of the xAOD container that is going to be processed by this algo. In this regard, the place of the algorithm in question in the ordered list defined in the steering macro is crucial. That is, if this algo is the first in the list to handle, say, muons, then the input conatiner will be the original xAOD container name (i.e., the one you see when you open the xAOD with the TBrowser or with the checkxAOD.py script). Whereas, if this algo processes muons after another algo, then the input conatiner will be the output container of the upstream algo! Setting this I/O flags in the wrong way will result in an unpleasant crash at runtime. Take some time to look at how the I/O are set with the current configuration I have. The
InputAlgoOutputAlgolines concern systematics management. Will explain about these soon...