Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ analyser::analyser(const edm::ParameterSet& iConfig)
Segment_prop = iConfig.getParameter<bool>("Segment_prop");
debug = iConfig.getParameter<bool>("debug");
isCosmic = iConfig.getParameter<bool>("isCosmic");
cout << "tracker_prop " << tracker_prop << " CSC_prop " << CSC_prop << " debug " << debug << std::endl;
cout << "tracker_prop " << tracker_prop << " CSC_prop " << CSC_prop << " Segment_prop " << Segment_prop << " debug " << debug << std::endl;

if(CSC_prop){CSC_tree = data_.book(CSC_tree, 1); prop_list.push_back(1);}
if(tracker_prop){Tracker_tree = data_.book(Tracker_tree, 2); prop_list.push_back(2);}
Expand Down Expand Up @@ -298,19 +298,19 @@ analyser::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){
if (! iEvent.getByToken(muons_, muons)) return;
if (muons->size() == 0) return;

cout << "new evt numb is " << iEvent.eventAuxiliary().event() << " and new lumiblock is " << iEvent.eventAuxiliary().luminosityBlock() << endl;
if (debug) cout << "new evt numb is " << iEvent.eventAuxiliary().event() << " and new lumiblock is " << iEvent.eventAuxiliary().luminosityBlock() << endl;

cout << "Run Number is " << iEvent.run() << std::endl;
if (debug) cout << "Run Number is " << iEvent.run() << std::endl;
for (size_t i = 0; i < muons->size(); ++i){
//cout << "new muon" << endl;
edm::RefToBase<reco::Muon> muRef = muons->refAt(i);
const reco::Muon* mu = muRef.get();

//if (mu->pt() < 2.0) continue; //can apply a pt cut later
if (not mu->standAloneMuon()) continue;
cout << "new standalone" << endl;
if (debug) cout << "new standalone" << endl;
for(auto it = std::begin(prop_list); it != std::end(prop_list); ++it){
std::cout << "prop " << *it << "about to start propagate" << std::endl;
if (debug) std::cout << "prop " << *it << "about to start propagate" << std::endl;
int prop_type = *it;
propagate(mu, prop_type, iEvent, i);
}
Expand Down Expand Up @@ -425,7 +425,7 @@ void analyser::propagate_to_GEM(const reco::Muon* mu, const GEMEtaPartition* ch,
const LocalPoint pos2D_local_ch(pos_local_ch.x(), pos_local_ch.y(), 0);
if (!(tsos_ch.globalPosition().z() * tsos_seg.globalPosition().z() < 0) and bps.bounds().inside(pos2D_local_ch) and ch->id().station() == 1 and ch->id().ring() == 1){
tmp_has_prop = true;
std::cout << "Delta to GEM!!! = " << used_delta << " prop " << prop_type << std::endl;
if (debug) std::cout << "Delta to GEM!!! = " << used_delta << " prop " << prop_type << std::endl;
pos_GP = tsos_ch.globalPosition();
pos_startingPoint_GP = tsos_seg.globalPosition();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from Configuration.AlCa.GlobalTag import GlobalTag
#process.CSCGeometryESModule.applyAlignment = cms.bool(False)

#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic_T15', '')
#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_realistic', '')
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2021_design', '')

process.MessageLogger.cerr.FwkReport.reportEvery = 5000
Expand Down Expand Up @@ -49,7 +47,8 @@
)
)

process.source.fileNames.append('file:step2.root')
#process.source.fileNames.append('file:step2.root')
process.source.fileNames.append('/store/data/Commissioning2021/ZeroBias0/AOD/PromptReco-v1/000/346/490/00000/9d646c8b-8067-42e4-adfe-ea69403eaa64.root')

process.options = cms.untracked.PSet(
SkipEvent = cms.untracked.vstring('ProductNotFound')
Expand All @@ -63,11 +62,12 @@
gemSimHits = cms.InputTag("g4SimHits", "MuonGEMHits"),
muons = cms.InputTag("muons"),
vertexCollection = cms.InputTag("offlinePrimaryVerticies"),
tracker_prop = cms.bool(False),
CSC_prop = cms.bool(True),
Segment_prop = cms.bool(True),
#Which propagations to do
tracker_prop = cms.bool(True), #From inner track
CSC_prop = cms.bool(True), #From CSC track
Segment_prop = cms.bool(True), #From ME1/1 segment
debug = cms.bool(False),
isCosmic = cms.bool(True)
isCosmic = cms.bool(True) #Cosmics go in opposite direction, ignores inner track
)

#process.p = cms.EndPath(process.analyser)
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# alignment
GEM alignment studies

CMSSW_12_0_3

```
scram p -n DirectoryName CMSSW_12_0_3
cd DirectoryName/src/
git clone git@github.com:gem-sw/alignment.git
cd alignment/GEM_Alignment/
cmsenv
scram b -j8
cd test
voms-proxy-init --rfc --voms cms
cmsRun analyser.py
```

Currently set to run all 3 propagation methods on a test file from 2021 Comissioning ZeroBias0 dataset