Skip to content

Commit

Permalink
Merge pull request #14880 from CTPPS/ctpps_rp_reco_algorithms_backport
Browse files Browse the repository at this point in the history
CTPPS: TOTEM RP local reconstruction algorithms - backport of #14605
  • Loading branch information
davidlange6 committed Jun 16, 2016
2 parents 859ab2c + e6d8404 commit afce6b9
Show file tree
Hide file tree
Showing 37 changed files with 1,755 additions and 42 deletions.
11 changes: 10 additions & 1 deletion Configuration/StandardSequences/python/RawToDigi_cff.py
Expand Up @@ -40,6 +40,7 @@
tcdsDigis = EventFilter.Utilities.tcdsRawToDigi_cfi.tcdsRawToDigi.clone()

from L1Trigger.Configuration.L1TRawToDigi_cff import *
from EventFilter.TotemRawToDigi.totemRawToDigi_cff import *

RawToDigi = cms.Sequence(L1TRawToDigi
+siPixelDigis
Expand Down Expand Up @@ -77,11 +78,19 @@
muonDTDigis.inputLabel = 'rawDataCollector'
muonRPCDigis.InputLabel = 'rawDataCollector'
castorDigis.InputLabel = 'rawDataCollector'

totemTriggerRawToDigi.rawDataTag = cms.InputTag("rawDataCollector")
totemRPRawToDigi.rawDataTag = cms.InputTag("rawDataCollector")

if eras.phase1Pixel.isChosen() :
RawToDigi.remove(siPixelDigis)
RawToDigi.remove(castorDigis)

# add CTPPS 2016 raw-to-digi modules
_ctpps_2016_RawToDigi = RawToDigi.copy()
_ctpps_2016_RawToDigi += totemTriggerRawToDigi + totemRPRawToDigi
eras.ctpps_2016.toReplaceWith(RawToDigi, _ctpps_2016_RawToDigi)

_ctpps_2016_RawToDigi_noTk = RawToDigi_noTk.copy()
_ctpps_2016_RawToDigi_noTk += totemTriggerRawToDigi + totemRPRawToDigi
eras.ctpps_2016.toReplaceWith(RawToDigi_noTk, _ctpps_2016_RawToDigi_noTk)

9 changes: 9 additions & 0 deletions Configuration/StandardSequences/python/Reconstruction_cff.py
Expand Up @@ -34,6 +34,7 @@
#local reconstruction
from RecoLocalTracker.Configuration.RecoLocalTracker_cff import *
from RecoParticleFlow.Configuration.RecoParticleFlow_cff import *
from RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff import *
#
# new tau configuration
#
Expand All @@ -46,6 +47,14 @@
localreco = cms.Sequence(trackerlocalreco+muonlocalreco+calolocalreco+castorreco)
localreco_HcalNZS = cms.Sequence(trackerlocalreco+muonlocalreco+calolocalrecoNZS+castorreco)

_ctpps_2016_localreco = localreco.copy()
_ctpps_2016_localreco += totemRPLocalReconstruction
eras.ctpps_2016.toReplaceWith(localreco, _ctpps_2016_localreco)

_ctpps_2016_localreco_HcalNZS = localreco_HcalNZS.copy()
_ctpps_2016_localreco_HcalNZS += totemRPLocalReconstruction
eras.ctpps_2016.toReplaceWith(localreco_HcalNZS, _ctpps_2016_localreco_HcalNZS)

#
# temporarily switching off recoGenJets; since this are MC and wil be moved to a proper sequence
#
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/CTPPSAlignment/src/classes.h
Expand Up @@ -4,12 +4,12 @@
#include "DataFormats/CTPPSAlignment/interface/RPAlignmentCorrectionData.h"
#include "DataFormats/CTPPSAlignment/interface/RPAlignmentCorrectionsData.h"

namespace {
namespace {
namespace DataFormats_CTPPSAlignment {
struct dictionary {
LocalTrackFit ltf;
edm::Wrapper<LocalTrackFit> wltf;

RPAlignmentCorrectionData ac;
RPAlignmentCorrectionsData acs;
}
};
}
6 changes: 3 additions & 3 deletions DataFormats/CTPPSReco/src/classes.h
Expand Up @@ -9,8 +9,8 @@

#include <vector>

namespace {
namespace {
namespace DataFormats_CTPPSReco {
struct dictionary {
TotemRPRecHit rp_reco_hit;
edm::DetSet<TotemRPRecHit> ds_rp_reco_hit;
edm::DetSetVector<TotemRPRecHit> dsv_rp_reco_hit;
Expand All @@ -35,5 +35,5 @@ namespace {
edm::Wrapper<edm::DetSetVector<TotemRPLocalTrack>> w_dsv_ft;
edm::DetSetVector<TotemRPLocalTrack::FittedRecHit> dsv_ft_frh;
edm::Wrapper<edm::DetSetVector<TotemRPLocalTrack::FittedRecHit>> w_dsv_ft_frh;
}
};
}
6 changes: 3 additions & 3 deletions DataFormats/TotemDigi/src/classes.h
Expand Up @@ -17,8 +17,8 @@

#include <vector>

namespace {
namespace {
namespace DataFormats_DataFormats {
struct dictionary {
TotemRPDigi rp_str_dig;
edm::DetSet<TotemRPDigi> ds_rp_str_dig;
std::vector<TotemRPDigi> vec_rp_str_dig;
Expand All @@ -43,5 +43,5 @@ namespace {
TotemFEDInfo fi;
std::vector<TotemFEDInfo> v_fi;
edm::Wrapper<std::vector<TotemFEDInfo>> w_v_fi;
}
};
}
6 changes: 3 additions & 3 deletions DataFormats/TotemRPDetId/src/classes.h
@@ -1,7 +1,7 @@
#include "DataFormats/TotemRPDetId/interface/TotemRPDetId.h"

namespace {
namespace {
namespace DataFormats_TotemRPDetId {
struct dictionary {
TotemRPDetId dummy0;
}
};
}
Expand Up @@ -23,11 +23,12 @@
_reco.globalreco.remove(_reco.offlineBeamSpot) # temporary removing this by hand, cause the usual removal (see end of this file) doesn't seem work

###########################################
# no castor / zdc in FastSim
# no castor, zdc, Totem RP in FastSim
###########################################
_reco.localreco.remove(_reco.castorreco)
_reco.globalreco.remove(_reco.CastorFullReco)
_reco.hcalLocalRecoSequence.remove(_reco.zdcreco)
_reco.localreco.remove(_reco.totemRPLocalReconstruction)

##########################################
# Calo rechits
Expand Down
2 changes: 1 addition & 1 deletion Geometry/VeryForwardData/python/Geom_RP_150_220_90_cfi.py
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
XMLIdealGeometryESSource_CTPPS = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring('Geometry/CMSCommonData/data/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/normal/cmsextent.xml',
Expand Down
5 changes: 4 additions & 1 deletion Geometry/VeryForwardGeometry/python/geometryRP_cfi.py
Expand Up @@ -81,11 +81,14 @@
'Geometry/VeryForwardData/data/RP_Cuts_Per_Region.xml',
'Geometry/VeryForwardData/data/RP_Param_Beam_Region.xml')

XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
XMLIdealGeometryESSource_CTPPS = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = totemGeomXMLFiles,
rootNodeName = cms.string('cms:CMSE')
)

# position of RPs
XMLIdealGeometryESSource_CTPPS.geomXMLFiles.append("Geometry/VeryForwardData/data/2016_ctpps_15sigma_margin0/RP_Dist_Beam_Cent.xml")

# extended geometries
TotemRPGeometryESModule = cms.ESProducer("TotemRPGeometryESModule",
verbosity = cms.untracked.uint32(1)
Expand Down
Expand Up @@ -418,7 +418,7 @@ auto_ptr<DDCompactView> TotemRPGeometryESModule::produceMeasuredDDCV(const VeryF
{
// get the ideal DDCompactView from EventSetup
edm::ESHandle<DDCompactView> idealCV;
iRecord.getRecord<IdealGeometryRecord>().get(idealCV);
iRecord.getRecord<IdealGeometryRecord>().get("XMLIdealGeometryESSource_CTPPS", idealCV);

// load alignments
edm::ESHandle<RPAlignmentCorrectionsData> alignments;
Expand Down
Expand Up @@ -6,7 +6,6 @@

# geometry
process.load("Geometry.VeryForwardGeometry.geometryRP_cfi")
process.XMLIdealGeometryESSource.geomXMLFiles.append('Geometry/VeryForwardData/data/RP_Garage/RP_Dist_Beam_Cent.xml')

# no events to process
process.source = cms.Source("EmptySource")
Expand Down
Expand Up @@ -6,7 +6,6 @@

# geometry
process.load("Geometry.VeryForwardGeometry.geometryRP_cfi")
process.XMLIdealGeometryESSource.geomXMLFiles.append('Geometry/VeryForwardData/data/RP_Garage/RP_Dist_Beam_Cent.xml')

# no events to process
process.source = cms.Source("EmptySource")
Expand Down
Expand Up @@ -7,7 +7,6 @@

# geometry
process.load("Geometry.VeryForwardGeometry.geometryRP_cfi")
process.XMLIdealGeometryESSource.geomXMLFiles.append('Geometry/VeryForwardData/data/RP_Garage/RP_Dist_Beam_Cent.xml')

# (no) events
process.maxEvents = cms.untracked.PSet(
Expand Down
20 changes: 9 additions & 11 deletions Geometry/VeryForwardRPTopology/interface/RPTopology.h
Expand Up @@ -19,8 +19,6 @@
#include "DataFormats/Math/interface/Point3D.h"


using namespace std;

namespace HepMC {
class ThreeVector;
}
Expand Down Expand Up @@ -56,16 +54,16 @@ class RPTopology
static bool IsHit(double u, double v, double insensitiveMargin = 0);

public:
const double sqrt_2;
static const double sqrt_2;

static double pitch_;
static double thickness_;
static unsigned short no_of_strips_;
static double x_width_;
static double y_width_;
static double phys_edge_lenght_;
static double last_strip_to_border_dist_;
static double last_strip_to_center_dist_;
static const double pitch_;
static const double thickness_;
static const unsigned short no_of_strips_;
static const double x_width_;
static const double y_width_;
static const double phys_edge_lenght_;
static const double last_strip_to_border_dist_;
static const double last_strip_to_center_dist_;

HepMC::ThreeVector strip_readout_direction_;
HepMC::ThreeVector strip_direction_;
Expand Down
21 changes: 10 additions & 11 deletions Geometry/VeryForwardRPTopology/src/RPTopology.cc
Expand Up @@ -10,22 +10,22 @@
#include "Geometry/VeryForwardRPTopology/interface/RPTopology.h"
#include <iostream>

unsigned short RPTopology::no_of_strips_ = 512;
const unsigned short RPTopology::no_of_strips_ = 512;

const double RPTopology::sqrt_2 = std::sqrt(2.0);
// all in mm
double RPTopology::pitch_ = 66E-3;
double RPTopology::thickness_ = 0.3;
double RPTopology::x_width_ = 36.07;
double RPTopology::y_width_ = 36.07;
double RPTopology::phys_edge_lenght_ = 22.276; //correct, but of vague impact, check sensitive edge efficiency curve
double RPTopology::last_strip_to_border_dist_ = 1.4175;
double RPTopology::last_strip_to_center_dist_ = RPTopology::x_width_/2. - RPTopology::last_strip_to_border_dist_; // assumes square shape
const double RPTopology::pitch_ = 66E-3;
const double RPTopology::thickness_ = 0.3;
const double RPTopology::x_width_ = 36.07;
const double RPTopology::y_width_ = 36.07;
const double RPTopology::phys_edge_lenght_ = 22.276; //correct, but of vague impact, check sensitive edge efficiency curve
const double RPTopology::last_strip_to_border_dist_ = 1.4175;
const double RPTopology::last_strip_to_center_dist_ = RPTopology::x_width_/2. - RPTopology::last_strip_to_border_dist_; // assumes square shape



RPTopology::RPTopology()
: sqrt_2(sqrt(2.0)),
strip_readout_direction_(0, 1, 0),
: strip_readout_direction_(0, 1, 0),
strip_direction_(1,0,0),
normal_direction_(0,0,1)
{
Expand All @@ -43,7 +43,6 @@ bool RPTopology::IsHit(double u, double v, double insensitiveMargin)
if (fabs(v) > last_strip_to_center_dist_)
return false;

double sqrt_2 = sqrt(2.);
double y = (u + v) / sqrt_2;
double edge_to_ceter_dist = (x_width_ - phys_edge_lenght_ / sqrt_2) / sqrt_2 - insensitiveMargin;
if (y < -edge_to_ceter_dist)
Expand Down
3 changes: 3 additions & 0 deletions RecoCTPPS/Configuration/python/RecoCTPPS_EventContent_cff.py
Expand Up @@ -30,6 +30,9 @@

RecoCTPPSAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep TotemFEDInfos_totemRPRawToDigi_*_*',
'keep TotemTriggerCounters_totemTriggerRawToDigi_*_*',
'keep TotemRPDigiedmDetSetVector_totemRPRawToDigi_*_*',
'keep TotemVFATStatusedmDetSetVector_totemRPRawToDigi_*_*',
'keep TotemRPClusteredmDetSetVector_totemRPClusterProducer_*_*',
'keep TotemRPRecHitedmDetSetVector_totemRPRecHitProducer_*_*',
Expand Down
4 changes: 4 additions & 0 deletions RecoCTPPS/Configuration/python/recoCTPPS_cff.py
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

from RecoCTPPS.TotemRPLocal.totemRPLocalReconstruction_cff import *
recoCTPPS = cms.Sequence(totemRPLocalReconstruction)
42 changes: 42 additions & 0 deletions RecoCTPPS/Configuration/test/raw_data_test.py
@@ -0,0 +1,42 @@
import FWCore.ParameterSet.Config as cms

process = cms.Process("TotemStandaloneRawDataTest")

# minimum of logs
process.MessageLogger = cms.Service("MessageLogger",
statistics = cms.untracked.vstring(),
destinations = cms.untracked.vstring('cout'),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('WARNING')
)
)

# raw data source
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring('file:/afs/cern.ch/user/j/jkaspar/public/run273062_ls0001-2_stream.root')
)

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(-1)
)

# raw-to-digi conversion
process.load("EventFilter.TotemRawToDigi.totemRawToDigi_cff")

# RP reconstruction chain with standard settings
process.load("RecoCTPPS.Configuration.recoCTPPS_cff")

process.p = cms.Path(
process.totemTriggerRawToDigi *
process.totemRPRawToDigi *
process.recoCTPPS
)

# output configuration
from RecoCTPPS.Configuration.RecoCTPPS_EventContent_cff import RecoCTPPSAOD
process.output = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string("file:./AOD.root"),
outputCommands = RecoCTPPSAOD.outputCommands
)

process.outpath = cms.EndPath(process.output)
14 changes: 14 additions & 0 deletions RecoCTPPS/TotemRPLocal/BuildFile.xml
@@ -0,0 +1,14 @@
<use name="FWCore/ParameterSet"/>

<use name="DataFormats/Common"/>
<use name="DataFormats/TotemDigi"/>
<use name="DataFormats/CTPPSReco"/>

<use name="Geometry/VeryForwardGeometryBuilder"/>
<use name="Geometry/VeryForwardRPTopology"/>

<use name="root"/>

<export>
<lib name="1"/>
</export>

0 comments on commit afce6b9

Please sign in to comment.