Data Processing Flow - danecross/PyNA62Analysis GitHub Wiki
In trying to understand the data manipulation process, there seems to be a somewhat established flow. This is what I gleaned from reading the templateAnalyzer.cc file. There are 13 official functions, but some of them are merely for pre- and post-processing. So as I see it there are 3 main parts with a few subparts. It follows similar procedure to most data processing so this is good.
This is where you tell the system which pre-defined trees, data, and compiler arguments that you will be using.
RequestTree(...) # specifies trees and their corresponding event class
RequestTriggerData(...) # Tell system what data to look for (in input file ?)
AddParam(...) # add compilation info
AddPrimitiveReader(...) # read a primitive file in parallel
SetLnMatchingWindowWidth(...) # where n = 0, 1, 2
This is where you tell the system which trees and variables you will be defining in the following functions.
RegisterOutput(...) # create output variables
OpenNewTree(..) # create new TTree
AddBranch<...>(..) # create a branch for your new TTree
CreateStandardTree(...) # create a standard TTree containing KineParts (for candidates)
This is where you tell the system which histograms and counters you plan on creating and which ones you want to access that have already been created
BookHisto(...) # initialize a histogram
BookCounter(...) # initialize a counter
NewEventFraction(...) # create a new event fraction
AddCounterToEventFraction(...) # self explanitory
DefineSampleSizeCounter(...) #
GetListOf...(...) # examine what is in an input file and what to use
RequestHistogram(...) # get a histogram that has already been created
Here you just initialize the particles to add to the MC simulation
fMCSimple.AddParticle(...)
These are all functions you can use if you have anything else to do before you start processing the data.
This is where the meat occurs, where we pull info that we want and get it ready to plot. There is only one function for this stage.
This function is called for as many events as is required. There are many parts to this method so I will break it down further:
fMCSimple["..."][i] # returns the ith particle with the ".." name
fParticleInterface->FindParticle("").Mass() # accesses the properties of the particle being accessed
GetEvent<MyClass>() # retrieves events from pre-defined trees
(eventClass*)GetEvent(...) # ^^
GetMCEvent(..) # retrieve full MC events
GetEventHeader(..) # retrieves the event header
GetObject<...>(..) # get data from generic TTrees
GetPrimitiveObject<..>(..) # ^^
GetLnData() # where n = 0, 1, 2
fHisto.Get...(..) # get the requested histogram
FillHisto(..) # fill the requested histogram with values
IncrementCounter('name') # increment the requested counter
DecrementCounter('name') # decrement the requested counter
CreateStandardCandidate(..) # append a candidate in one of your standard output Tree
FillTrees(..) # save this event in your custom and standard TTrees
FilterAccept() # replicate this event in the output file
FindAllPrimitiveInMatchingWindow(..) # get all the primitives in a certain window around the event timestamp
FindMatchingPrimitive(..) # get the primitive closest the the event timestamp
This is where you put anything that you need to do before the plot-making step
This is where you save plots
SaveAllPlots()
histogram->write()
GetIterator...()
This is where the plots are drawn
DrawAllPlots(...)
fHisto.get...("histoname")...