-
Notifications
You must be signed in to change notification settings - Fork 575
[PWGEM] Other format for trigger normalization histos #12771
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
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
|
@@ -8,7 +8,7 @@ | |
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
// | ||
Check failure on line 11 in PWGEM/Dilepton/TableProducer/skimmerOTS.cxx
|
||
// ======================== | ||
// | ||
// This code produces trigger information. OTS = offline trigger selection. | ||
|
@@ -33,17 +33,27 @@ | |
using namespace o2::framework::expressions; | ||
using namespace o2::soa; | ||
|
||
// Enum containing the ordering of statistics histograms for the zorro information | ||
enum SkimStatsHists { | ||
kStatsZorroInfo = 0, | ||
kStatsZorroSel | ||
}; | ||
|
||
struct skimmerOTS { | ||
Produces<o2::aod::EMSWTriggerInfosTMP> swt_tmp; | ||
|
||
// CCDB options | ||
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; | ||
Configurable<std::string> cfgCcdbPathZorro{"ccdb-path-zorro", "/Users/m/mpuccio/EventFiltering/OTS/Chunked/", "base path to the ccdb object for zorro"}; | ||
Configurable<std::string> cfg_swt_names{"cfg_swt_names", "fHighTrackMult,fHighFt0Mult", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation! | ||
Configurable<uint64_t> cfgBcTolerance{"cfgBcTolerance", 100, "Number of BCs of margin for software triggers"}; | ||
|
||
std::vector<std::string> swt_names; | ||
int mRunNumber; | ||
Service<o2::ccdb::BasicCCDBManager> ccdb; | ||
|
||
OutputObj<TList> fStatsList{"Zorro"}; //! Info from Zorro | ||
|
||
HistogramRegistry registry{"registry"}; | ||
void init(o2::framework::InitContext&) | ||
{ | ||
|
@@ -66,7 +76,12 @@ | |
hEventCounter->GetXaxis()->SetBinLabel(idx + 2, swt_names[idx].data()); | ||
} | ||
|
||
registry.add("hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); | ||
fStatsList.setObject(new TList()); | ||
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. Can you move histograms under registry? 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. Hi Daiki, I am sorry but by me this solution did not compile. It was complaining about a impossible convertion of a std::shared_pt into reinterpret_cast<TH2D*>. |
||
fStatsList->SetOwner(kTRUE); | ||
TH2D* histZorroInfo = new TH2D("ZorroInfo", "Zorro information", 1, -0.5, 0.5, 1, -0.5, 0.5); | ||
fStatsList->AddAt(histZorroInfo, kStatsZorroInfo); | ||
TH2D* histZorroSel = new TH2D("ZorroSel", "trigger of interested", 1, -0.5, 0.5, 1, -0.5, 0.5); | ||
fStatsList->AddAt(histZorroSel, kStatsZorroSel); | ||
} | ||
|
||
~skimmerOTS() | ||
|
@@ -85,14 +100,14 @@ | |
if (mRunNumber == bc.runNumber()) { | ||
return; | ||
} | ||
|
||
zorro.setBaseCCDBPath(cfgCcdbPathZorro.value); | ||
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. This is not needed anymore, because zorro objects have been moved to common directory. |
||
zorro.setBCtolerance(cfgBcTolerance); | ||
mTOIidx = zorro.initCCDB(ccdb.service, bc.runNumber(), bc.timestamp(), cfg_swt_names.value); | ||
for (auto& idx : mTOIidx) { | ||
LOGF(info, "Trigger of Interest : index = %d", idx); | ||
} | ||
mNinspectedTVX = zorro.getInspectedTVX()->GetBinContent(1); | ||
LOGF(info, "total inspected TVX events = %d in run number %d", mNinspectedTVX, bc.runNumber()); | ||
registry.fill(HIST("hNInspectedTVX"), bc.runNumber(), mNinspectedTVX); | ||
|
||
mRunNumber = bc.runNumber(); | ||
} | ||
|
@@ -102,16 +117,17 @@ | |
|
||
void process(MyCollisions const& collisions, MyBCs const&) | ||
{ | ||
for (auto& collision : collisions) { | ||
auto bc = collision.template bc_as<MyBCs>(); // don't use foundBC. | ||
initCCDB(bc); | ||
|
||
uint16_t trigger_bitmap = 0; | ||
registry.fill(HIST("hEventCounter"), 1); // all | ||
zorro.populateHistRegistry(registry, bc.runNumber()); | ||
registry.fill(HIST("hEventCounter"), 1); // all | ||
zorro.populateExternalHists(bc.runNumber(), reinterpret_cast<TH2D*>(fStatsList->At(kStatsZorroInfo)), reinterpret_cast<TH2D*>(fStatsList->At(kStatsZorroSel))); | ||
|
||
if (zorro.isSelected(bc.globalBC())) { // triggered event | ||
auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch | ||
// if (zorro.isSelected(bc.globalBC())) { // triggered event | ||
if (zorro.isSelected(bc.globalBC(), cfgBcTolerance, reinterpret_cast<TH2D*>(fStatsList->At(kStatsZorroSel)))) { // triggered event | ||
auto swt_bitset = zorro.getLastResult(); // this has to be called after zorro::isSelected, or simply call zorro.fetch | ||
// LOGF(info, "swt_bitset.to_string().c_str() = %s", swt_bitset.to_string().c_str()); | ||
for (size_t idx = 0; idx < mTOIidx.size(); idx++) { | ||
if (swt_bitset.test(mTOIidx[idx])) { | ||
|
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.
can you keep hNInspectedTVX?
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.
The number of insptected TVX is in the zorro info histo, so that to avoid duplication of information I removed it.