-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the photon kinematics for the EMCal clusters QA type plots #3175
base: master
Are you sure you want to change the base?
Changes from all commits
43fe149
3646d30
3622882
0dbc266
4a11793
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,220 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "photonjetskinematics.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <fun4all/PHTFileServer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Fun4all includes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <fun4all/Fun4AllHistoManager.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <fun4all/Fun4AllReturnCodes.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <phool/PHCompositeNode.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <TFile.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <phool/getClass.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "TH1.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include "TMath.h" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
//#include <jetbase/JetContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Tower includes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawCluster.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawClusterContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawClusterUtility.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawTower.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawTowerContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawTowerGeom.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawTowerGeomContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/TowerInfo.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/TowerInfoContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/TowerInfoDefs.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Cluster includes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawCluster.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <calobase/RawClusterContainer.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we'll need to include the QA hist manager!
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// QA includes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <qautils/QAHistManagerDef.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll also need a few standard headers as well...
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// c++ includes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <algorithm> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <cassert> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <iostream> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
#include <vector> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
photonjetskinematics::photonjetskinematics(const std::string &m_modulename, const std::string &m_inputnode) : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apologies! I should've been more clear: the |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubsysReco(m_modulename) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
, modulename(m_modulename) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
, inputnode(m_inputnode) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
, histtag("AllTrig") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
, trgToSelect(JetQADefs::GL1::MBDNSJet1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
, doTrgSelect(false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+48
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we'll need to initialize
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::photonjetskinematics(const std::string &name, const std::string&outputfilename) Calling ctor" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
photonjetskinematics::~photonjetskinematics() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << "photonjetskinematics::~photonjetskinematics() Calling dtor" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::Init(PHCompositeNode* /*topNode*/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::Init(PHCompositeNode *topNode) Initializing" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager = QAHistManagerDef::getHistoManager(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!manager) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::cerr << PHWHERE << "PANIC: couldn't grab histogram manager!" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
assert(manager); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// make sure module name is lower case | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::string smallModuleName = modulename; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::transform( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
smallModuleName.begin(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
smallModuleName.end(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
smallModuleName.begin(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
::tolower); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
// construct histogram names | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::vector<std::string> vecHistNames = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
"emcal_cluster_chi2", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
"emcal_cluster_energy", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
"emcal_cluster_eta_phi", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
"emcal_cluster_eta", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
"emcal_cluster_phi"}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (auto& histName : vecHistNames) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
histName.insert(0, "h_" + smallModuleName + "_"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!histtag.empty()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
histName.append("_" + histtag); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following suggestion is for making sure the histogram names conform to the same pattern that most of the other modules follow:
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//initializing histograms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_chi2 = new TH1D(vecHistNames[0].data(), "h_emcal_cluster_chi2", 30, 0, 150); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_chi2->GetXaxis()->SetTitle("#chi^{2}"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_energy = new TH1D(vecHistNames[1].data(), "h_emcal_cluster_energy", 100, 0, 10); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_energy->GetXaxis()->SetTitle("E_{T} [GeV]"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta_phi = new TH2F(vecHistNames[2].data(), "h_emcal_cluster_eta_phi", 140, -1.2, 1.2, 64, -M_PI, M_PI); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta_phi->GetXaxis()->SetTitle("#eta"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta_phi->GetYaxis()->SetTitle("#Phi"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta_phi->SetOption("COLZ"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta = new TH1D(vecHistNames[3].data(), "Eta Distribution", 140, -1.2, 1.2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta->GetXaxis()->SetTitle("#eta"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_phi = new TH1D(vecHistNames[4].data(), "Phi Distribution", 64, -M_PI, M_PI); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_phi->GetXaxis()->SetTitle("#phi"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::InitRun(PHCompositeNode* /*topNode*/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::process_event(PHCompositeNode *topNode) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
RawClusterContainer* clusterContainer = findNode::getClass<RawClusterContainer>(topNode, inputnode); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!clusterContainer) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::cout << PHWHERE << "funkyCaloStuff::process_event - Fatal Error - CLUSTER_CEMC node is missing. " << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to add a chunk of code here to filter out events which don't have the trigger we're interested in if we're applying a trigger selection.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// if needed, check if trigger fired | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (doTrgSelect) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
bool hasTrigger = JetQADefs::DidTriggerFire(trgToSelect, topNode); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (!hasTrigger) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
RawClusterContainer::ConstIterator clusterIter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
RawClusterContainer::ConstRange clusterEnd = clusterContainer->getClusters(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (clusterIter = clusterEnd.first; clusterIter != clusterEnd.second; clusterIter++) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
RawCluster* recoCluster = clusterIter->second; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
CLHEP::Hep3Vector vertex(0, 0, 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
CLHEP::Hep3Vector E_vec_cluster = RawClusterUtility::GetECoreVec(*recoCluster, vertex); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
float clusE = E_vec_cluster.mag(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
float clus_eta = E_vec_cluster.pseudoRapidity(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
float clus_phi = E_vec_cluster.phi(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
float clus_chisq = recoCluster->get_chi2(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//Filling Histograms, only taking into account E vec cluster, not reco cluster | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_chi2->Fill(clus_chisq); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_energy->Fill(clusE); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta_phi->Fill(clus_eta, clus_phi); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_eta->Fill(clus_eta); // 1D eta plot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
h_emcal_cluster_phi->Fill(clus_phi); // 1D phi plot | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
// std::cout << "photonjetskinematics::process_event(PHCompositeNode *topNode) Processing Event" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::ResetEvent(PHCompositeNode* /*topNode*/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
// std::cout << "photonjetskinematics::ResetEvent(PHCompositeNode *topNode) Resetting internal structures, prepare for next event" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::EndRun(const int runnumber) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::End(PHCompositeNode* /*topNode*/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Commenting out the following line because Jenkins keeps failing the build test :( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
// if (Verbosity() > 1) std::cout << "photonjetskinematics::End - Output to " << outfilename << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//Outputting the histograms | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager->registerHisto(h_emcal_cluster_eta_phi); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager->registerHisto(h_emcal_cluster_energy); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager->registerHisto(h_emcal_cluster_chi2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager->registerHisto(h_emcal_cluster_eta); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
manager->registerHisto(h_emcal_cluster_phi); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::End(PHCompositeNode *topNode) This is the End..." << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int photonjetskinematics::Reset(PHCompositeNode* /*topNode*/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::Reset(PHCompositeNode *topNode) being Reset" << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return Fun4AllReturnCodes::EVENT_OK; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
//____________________________________________________________________________.. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
void photonjetskinematics::Print(const std::string &what) const | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (Verbosity() > 1) std::cout << "photonjetskinematics::Print(const std::string &what) const Printing info for " << what << std::endl; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,94 @@ | ||||||||||||||||||||||||||||||||
// Tell emacs that this is a C++ source | ||||||||||||||||||||||||||||||||
// -*- C++ -*-. | ||||||||||||||||||||||||||||||||
#ifndef PHOTONJETSKINEMATICS_H | ||||||||||||||||||||||||||||||||
#define PHOTONJETSKINEMATICS_H | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#include <fun4all/SubsysReco.h> | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#include <string> | ||||||||||||||||||||||||||||||||
#include <TFile.h> | ||||||||||||||||||||||||||||||||
#include <TH1.h> | ||||||||||||||||||||||||||||||||
#include <TH2D.h> | ||||||||||||||||||||||||||||||||
#include "JetQADefs.h" | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need this for the trigger indices.
Suggested change
|
||||||||||||||||||||||||||||||||
class Fun4AllHistoManager; | ||||||||||||||||||||||||||||||||
class PHCompositeNode; | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need to do a forward declaration for the hist manager...
Suggested change
|
||||||||||||||||||||||||||||||||
class TH1; | ||||||||||||||||||||||||||||||||
class TH2; | ||||||||||||||||||||||||||||||||
class TH3; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
class photonjetskinematics : public SubsysReco | ||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||
public: | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
photonjetskinematics(const std::string &modulename = "photonjetskinematics", const std::string &inputnode = "CLUSTERINFO_CEMC"); | ||||||||||||||||||||||||||||||||
~photonjetskinematics() override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** Called during initialization. | ||||||||||||||||||||||||||||||||
Typically this is where you can book histograms, and e.g. | ||||||||||||||||||||||||||||||||
register them to Fun4AllServer (so they can be output to file | ||||||||||||||||||||||||||||||||
using Fun4AllServer::dumpHistos() method). | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
int Init(PHCompositeNode *topNode) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** Called for first event when run number is known. | ||||||||||||||||||||||||||||||||
Typically this is where you may want to fetch data from | ||||||||||||||||||||||||||||||||
database, because you know the run number. A place | ||||||||||||||||||||||||||||||||
to book histograms which have to know the run number. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
int InitRun(PHCompositeNode *topNode) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/** Called for each event. | ||||||||||||||||||||||||||||||||
This is where you do the real work. | ||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||
int process_event(PHCompositeNode *topNode) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/// Clean up internals after each event. | ||||||||||||||||||||||||||||||||
int ResetEvent(PHCompositeNode *topNode) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/// Called at the end of each run. | ||||||||||||||||||||||||||||||||
int EndRun(const int runnumber) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/// Called at the end of all processing. | ||||||||||||||||||||||||||||||||
int End(PHCompositeNode *topNode) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
/// Reset | ||||||||||||||||||||||||||||||||
int Reset(PHCompositeNode * /*topNode*/) override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
void Print(const std::string &what = "ALL") const override; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just in case we want to check this as a function of trigger type (e.g. Photon5), we'll need some way to set which trigger to select.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll want to be able to add additional tags to histogram names to label things (e.g. if we're selecting a particular trigger), so we'll need to add a setter.
Suggested change
|
||||||||||||||||||||||||||||||||
/// specifies a trigger to select | ||||||||||||||||||||||||||||||||
void SetTrgToSelect(const uint32_t trig = JetQADefs::GL1::MBDNSPhoton1) | ||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||
doTrgSelect = true; | ||||||||||||||||||||||||||||||||
trgToSelect = trig; | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll want to add a few members here for bookkeeping:
Suggested change
|
||||||||||||||||||||||||||||||||
/// set histogram tag | ||||||||||||||||||||||||||||||||
void SetHistTag(const std::string& tag) | ||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||
histtag = tag; | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll need the hist manager to collect the output histograms...
Suggested change
|
||||||||||||||||||||||||||||||||
private: | ||||||||||||||||||||||||||||||||
// std::string outfilename; | ||||||||||||||||||||||||||||||||
// TFile *outfile; | ||||||||||||||||||||||||||||||||
// hist manager | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
Fun4AllHistoManager* manager; | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So (hopefully 🤞) this is the last issue: |
||||||||||||||||||||||||||||||||
std::string modulename; | ||||||||||||||||||||||||||||||||
std::string inputnode; | ||||||||||||||||||||||||||||||||
std::string histtag; | ||||||||||||||||||||||||||||||||
uint32_t trgToSelect; | ||||||||||||||||||||||||||||||||
bool doTrgSelect; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
///Output histograms | ||||||||||||||||||||||||||||||||
TH1 *h_emcal_cluster_chi2 = nullptr; | ||||||||||||||||||||||||||||||||
TH1 *h_emcal_cluster_energy = nullptr; | ||||||||||||||||||||||||||||||||
TH2 *h_emcal_cluster_eta_phi = nullptr; | ||||||||||||||||||||||||||||||||
TH1 *h_emcal_cluster_eta = nullptr; // <-- Declare eta histogram | ||||||||||||||||||||||||||||||||
TH1 *h_emcal_cluster_phi = nullptr; // <-- Declare phi histogram | ||||||||||||||||||||||||||||||||
}; | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
#endif // PHOTONJETSKINEMATICS_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to add include the hist manager here!