Skip to content

Commit

Permalink
Merge pull request #17701 from CTPPS/ctpps_miniaod_resubmit2
Browse files Browse the repository at this point in the history
CTPPS: miniAOD (second resubmission)
  • Loading branch information
davidlange6 committed Mar 5, 2017
2 parents c632840 + fa8e156 commit c52e463
Show file tree
Hide file tree
Showing 14 changed files with 261 additions and 61 deletions.
70 changes: 27 additions & 43 deletions DQM/CTPPS/plugins/TotemRPDQMSource.cc
Expand Up @@ -157,6 +157,8 @@ using namespace edm;

void TotemRPDQMSource::GlobalPlots::Init(DQMStore::IBooker &ibooker)
{
ibooker.setCurrentFolder("CTPPS/TrackingStrip");

events_per_bx = ibooker.book1D("events per BX", "rp;Event.BX", 4002, -1.5, 4000. + 0.5);
events_per_bx_short = ibooker.book1D("events per BX (short)", "rp;Event.BX", 102, -1.5, 100. + 0.5);

Expand Down Expand Up @@ -476,10 +478,10 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
if (! tr1.isValid())
continue;

unsigned int rpId1 = ds1.detId();
unsigned int arm1 = rpId1 / 100;
unsigned int stNum1 = (rpId1 / 10) % 10;
unsigned int rpNum1 = rpId1 % 10;
CTPPSDetId rpId1(ds1.detId());
unsigned int arm1 = rpId1.arm();
unsigned int stNum1 = rpId1.station();
unsigned int rpNum1 = rpId1.rp();
if (stNum1 != 0 || (rpNum1 != 2 && rpNum1 != 3))
continue;
unsigned int idx1 = arm1*2 + rpNum1-2;
Expand All @@ -491,10 +493,10 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
if (! tr2.isValid())
continue;

unsigned int rpId2 = ds2.detId();
unsigned int arm2 = rpId2 / 100;
unsigned int stNum2 = (rpId2 / 10) % 10;
unsigned int rpNum2 = rpId2 % 10;
CTPPSDetId rpId2(ds2.detId());
unsigned int arm2 = rpId2.arm();
unsigned int stNum2 = rpId2.station();
unsigned int rpNum2 = rpId2.rp();
if (stNum2 != 0 || (rpNum2 != 2 && rpNum2 != 3))
continue;
unsigned int idx2 = arm2*2 + rpNum2-2;
Expand Down Expand Up @@ -575,11 +577,7 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
// plane efficiency plots
for (auto &ds : *tracks)
{
unsigned int rpDecId = ds.detId();
unsigned int armIdx = rpDecId / 100;
unsigned int stIdx = (rpDecId / 10) % 10;
unsigned int rpIdx = rpDecId % 10;
TotemRPDetId rpId(armIdx, stIdx, rpIdx);
CTPPSDetId rpId(ds.detId());

for (auto &ft : ds)
{
Expand All @@ -590,7 +588,8 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e

for (unsigned int plNum = 0; plNum < 10; ++plNum)
{
TotemRPDetId plId(armIdx, stIdx, rpIdx, plNum);
TotemRPDetId plId = rpId;
plId.setPlane(plNum);

double ft_z = ft.getZ0();
double ft_x = ft.getX0() + ft.getTx() * (ft_z - rp_z);
Expand Down Expand Up @@ -700,11 +699,7 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
// recognized pattern histograms
for (auto &ds : *patterns)
{
unsigned int rpDecId = ds.detId();
unsigned int armIdx = rpDecId / 100;
unsigned int stIdx = (rpDecId / 10) % 10;
unsigned int rpIdx = rpDecId % 10;
TotemRPDetId rpId(armIdx, stIdx, rpIdx);
CTPPSDetId rpId(ds.detId());

PotPlots &pp = potPlots[rpId];

Expand Down Expand Up @@ -737,8 +732,7 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
unsigned int pl_v = planes_v[rpId].size();

// process pattern data for this pot
unsigned int rpDecId = rpId.getRPDecimalId();
const auto &rp_pat_it = patterns->find(rpDecId);
const auto &rp_pat_it = patterns->find(rpId);

unsigned int pat_u = 0, pat_v = 0;
if (rp_pat_it != patterns->end())
Expand Down Expand Up @@ -779,11 +773,7 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
// RP track-fit plots
for (auto &ds : *tracks)
{
unsigned int rpDecId = ds.detId();
unsigned int armIdx = rpDecId / 100;
unsigned int stIdx = (rpDecId / 10) % 10;
unsigned int rpIdx = rpDecId % 10;
TotemRPDetId rpId(armIdx, stIdx, rpIdx);
CTPPSDetId rpId(ds.detId());

PotPlots &pp = potPlots[rpId];

Expand Down Expand Up @@ -856,15 +846,9 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e

for (auto &ds : *tracks)
{
unsigned int rpDecId = ds.detId();
unsigned int armIdx = rpDecId / 100;
unsigned int stIdx = (rpDecId / 10) % 10;
unsigned int rpIdx = rpDecId % 10;
TotemRPDetId rpId(armIdx, stIdx, rpIdx);

CTPPSDetId rpId(ds.detId());
unsigned int rpNum = rpId.rp();

TotemRPDetId armId = rpId.getArmId();
CTPPSDetId armId = rpId.getArmId();

for (auto &tr : ds)
{
Expand Down Expand Up @@ -895,14 +879,14 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
if (! tr1.isValid())
continue;

unsigned int rpDecId1 = ds1.detId();
unsigned int arm1 = rpDecId1 / 100;
unsigned int stNum1 = (rpDecId1 / 10) % 10;
unsigned int rpNum1 = rpDecId1 % 10;
CTPPSDetId rpId1(ds1.detId());
unsigned int arm1 = rpId1.arm();
unsigned int stNum1 = rpId1.station();
unsigned int rpNum1 = rpId1.rp();
unsigned int idx1 = stNum1/2 * 7 + rpNum1;
bool hor1 = (rpNum1 == 2 || rpNum1 == 3);

TotemRPDetId armId(arm1, 0);
CTPPSDetId armId = rpId1.getArmId();
ArmPlots &ap = armPlots[armId];

for (auto &ds2 : *tracks)
Expand All @@ -912,10 +896,10 @@ void TotemRPDQMSource::analyze(edm::Event const& event, edm::EventSetup const& e
if (! tr2.isValid())
continue;

unsigned int rpDecId2 = ds2.detId();
unsigned int arm2 = rpDecId2 / 100;
unsigned int stNum2 = (rpDecId2 / 10) % 10;
unsigned int rpNum2 = rpDecId2 % 10;
CTPPSDetId rpId2(ds2.detId());
unsigned int arm2 = rpId2.arm();
unsigned int stNum2 = rpId2.station();
unsigned int rpNum2 = rpId2.rp();
unsigned int idx2 = stNum2/2 * 7 + rpNum2;
bool hor2 = (rpNum2 == 2 || rpNum2 == 3);

Expand Down
83 changes: 83 additions & 0 deletions DataFormats/CTPPSReco/interface/CTPPSLocalTrackLite.h
@@ -0,0 +1,83 @@
/****************************************************************************
*
* This is a part of TOTEM offline software.
* Authors:
* Jan Kašpar (jan.kaspar@gmail.com)
*
****************************************************************************/

#ifndef DataFormats_CTPPSReco_CTPPSLocalTrackLite
#define DataFormats_CTPPSReco_CTPPSLocalTrackLite

/**
*\brief Local (=single RP) track with essential information only.
**/
class CTPPSLocalTrackLite
{
public:
CTPPSLocalTrackLite() : rpId(0), x(0.), x_unc(-1.), y(0.), y_unc(-1.), time(0.), time_unc(-1.)
{
}

CTPPSLocalTrackLite(uint32_t pid, float px, float pxu, float py, float pyu, float pt=0., float ptu=-1.)
: rpId(pid), x(px), x_unc(pxu), y(py), y_unc(pyu), time(pt), time_unc(ptu)
{
}

/// returns the RP id
uint32_t getRPId() const
{
return rpId;
}

/// returns the horizontal track position
float getX() const
{
return x;
}

/// returns the horizontal track position uncertainty
float getXUnc() const
{
return x_unc;
}

/// returns the vertical track position
float getY() const
{
return y;
}

/// returns the vertical track position uncertainty
float getYUnc() const
{
return y_unc;
}

/// returns the track time
float getTime() const
{
return time;
}

/// returns the track time uncertainty
float getTimeUnc() const
{
return time_unc;
}

protected:
/// RP id
uint32_t rpId;

/// horizontal hit position and uncertainty, mm
float x, x_unc;

/// vertical hit position and uncertainty, mm
float y, y_unc;

/// time information and uncertainty
float time, time_unc;
};

#endif
8 changes: 8 additions & 0 deletions DataFormats/CTPPSReco/src/classes.h
Expand Up @@ -11,6 +11,8 @@

#include "DataFormats/CTPPSReco/interface/CTPPSDiamondRecHit.h"

#include "DataFormats/CTPPSReco/interface/CTPPSLocalTrackLite.h"

#include <vector>

namespace DataFormats_CTPPSReco {
Expand Down Expand Up @@ -56,5 +58,11 @@ namespace DataFormats_CTPPSReco {
edm::DetSetVector<CTPPSDiamondRecHit> dsv_ctd_rh;
edm::Wrapper< edm::DetSetVector<CTPPSDiamondRecHit> > wrp_dsv_ctd_rh;

//--- common objects

CTPPSLocalTrackLite cltl;
std::vector<CTPPSLocalTrackLite> v_cltl;
edm::Wrapper<CTPPSLocalTrackLite> w_cltl;
edm::Wrapper<std::vector<CTPPSLocalTrackLite>> w_v_cltl;
};
}
8 changes: 8 additions & 0 deletions DataFormats/CTPPSReco/src/classes_def.xml
Expand Up @@ -56,4 +56,12 @@
<class name="edm::DetSetVector<CTPPSDiamondRecHit>"/>
<class name="edm::Wrapper< edm::DetSetVector<CTPPSDiamondRecHit> >"/>

<!-- common objects -->

<class name="CTPPSLocalTrackLite" ClassVersion="3">
<version ClassVersion="3" checksum="3838813906"/>
</class>
<class name="std::vector<CTPPSLocalTrackLite>"/>
<class name="edm::Wrapper<CTPPSLocalTrackLite>"/>
<class name="edm::Wrapper<std::vector<CTPPSLocalTrackLite>>"/>
</lcgdict>
Expand Up @@ -65,6 +65,8 @@
'keep recoBeamHaloSummary_BeamHaloSummary_*_*',
# Lumi
'keep LumiScalerss_scalersRawToDigi_*_*',
# CTPPS
'keep CTPPSLocalTrackLites_ctppsLocalTrackLiteProducer_*_*'
)
)
MicroEventContentMC = cms.PSet(
Expand Down
1 change: 1 addition & 0 deletions PhysicsTools/PatAlgos/python/slimming/miniAOD_tools.py
Expand Up @@ -359,6 +359,7 @@ def miniAOD_customizeOutput(out):
def miniAOD_customizeData(process):
from PhysicsTools.PatAlgos.tools.coreTools import runOnData
runOnData( process, outputModules = [] )
process.load("RecoCTPPS.TotemRPLocal.ctppsLocalTrackLiteProducer_cfi")

def miniAOD_customizeAllData(process):
miniAOD_customizeCommon(process)
Expand Down
9 changes: 9 additions & 0 deletions RecoCTPPS/Configuration/python/RecoCTPPS_EventContent_cff.py
Expand Up @@ -19,6 +19,9 @@
'keep CTPPSDiamondDigiedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep TotemVFATStatusedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep CTPPSDiamondRecHitedmDetSetVector_ctppsDiamondRecHits_*_*',

# CTPPS common
'keep CTPPSLocalTrackLites_ctppsLocalTrackLiteProducer_*_*'
)
)

Expand All @@ -42,6 +45,9 @@
'keep CTPPSDiamondDigiedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep TotemVFATStatusedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep CTPPSDiamondRecHitedmDetSetVector_ctppsDiamondRecHits_*_*',

# CTPPS common
'keep CTPPSLocalTrackLites_ctppsLocalTrackLiteProducer_*_*'
)
)

Expand All @@ -65,5 +71,8 @@
'keep CTPPSDiamondDigiedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep TotemVFATStatusedmDetSetVector_ctppsDiamondRawToDigi_*_*',
'keep CTPPSDiamondRecHitedmDetSetVector_ctppsDiamondRecHits_*_*',

# CTPPS common
'keep CTPPSLocalTrackLites_ctppsLocalTrackLiteProducer_*_*'
)
)
4 changes: 3 additions & 1 deletion RecoCTPPS/Configuration/test/raw_data_test.py
@@ -1,6 +1,7 @@
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras

process = cms.Process("CTPPSReconstructionChainTest")
process = cms.Process("CTPPSReconstructionChainTest", eras.ctpps_2016)

# minimum of logs
process.MessageLogger = cms.Service("MessageLogger",
Expand All @@ -16,6 +17,7 @@
fileNames = cms.untracked.vstring(
# run 274199, fill 4961, 29 May 2016 (before TS1)
'/store/data/Run2016B/DoubleEG/RAW/v2/000/274/199/00000/04985451-9B26-E611-BEB9-02163E013859.root',
#'root://eostotem.cern.ch//eos/totem/user/j/jkaspar/04C8034A-9626-E611-9B6E-02163E011F93.root'

# run 283877, fill 5442, 23 Oct 2016 (after TS2)
'/store/data/Run2016H/HLTPhysics/RAW/v1/000/283/877/00000/F28F8896-999B-E611-93D8-02163E013706.root'
Expand Down

0 comments on commit c52e463

Please sign in to comment.