|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | +// O2 includes |
| 12 | + |
| 13 | +#include "CommonDataFormat/InteractionRecord.h" |
| 14 | +#include "Framework/AnalysisTask.h" |
| 15 | +#include "Framework/runDataProcessing.h" |
| 16 | + |
| 17 | +using namespace o2; |
| 18 | +using namespace o2::framework; |
| 19 | + |
| 20 | +struct checkCollisionBC { |
| 21 | + int mDFcounter = 0; |
| 22 | + int mPrevId = -1; |
| 23 | + unsigned int mMinOrbit = constants::lhc::MaxNOrbits; |
| 24 | + unsigned int mMaxOrbit = 0; |
| 25 | + void init(InitContext&) {} |
| 26 | + |
| 27 | + void process(aod::Collisions const& collisions, aod::BCs const& bcs) |
| 28 | + { |
| 29 | + InteractionRecord ir; |
| 30 | + for (auto& collision : collisions) { |
| 31 | + if (collision.globalIndex() < mPrevId) { |
| 32 | + mDFcounter++; |
| 33 | + } |
| 34 | + mPrevId = collision.globalIndex(); |
| 35 | + auto bc = collision.bc(); |
| 36 | + ir.setFromLong(bc.globalBC()); |
| 37 | + if (ir.orbit < mMinOrbit) { |
| 38 | + mMinOrbit = ir.orbit; |
| 39 | + } |
| 40 | + if (ir.orbit > mMaxOrbit) { |
| 41 | + mMaxOrbit = ir.orbit; |
| 42 | + } |
| 43 | + /// original 1177489722044 |
| 44 | + if (ir.orbit == 330384321) { |
| 45 | + LOGF(info, "BC: %d, %d, %d", bc.globalBC(), ir.bc, ir.orbit); |
| 46 | + LOGF(info, "Collision: %d, BC: %d", collision.globalIndex(), bc.globalIndex()); |
| 47 | + LOGF(info, "Collision vertex: %f, %f, %f", collision.posX(), collision.posY(), collision.posZ()); |
| 48 | + LOGF(info, "Collision number of contributors: %d", collision.numContrib()); |
| 49 | + LOGF(info, "Collision time and resolution: %f %f", collision.collisionTime(), collision.collisionTimeRes()); |
| 50 | + LOGF(info, "DFcounter %i", mDFcounter); |
| 51 | + } |
| 52 | + } |
| 53 | + LOGF(info, "Min-Max orbit %i %i", mMinOrbit, mMaxOrbit); |
| 54 | + } |
| 55 | +}; |
| 56 | + |
| 57 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 58 | +{ |
| 59 | + return WorkflowSpec{ |
| 60 | + adaptAnalysisTask<checkCollisionBC>(cfgc, TaskName{"checkCollisionBC"}), |
| 61 | + }; |
| 62 | +} |
0 commit comments