Skip to content
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

ME0 pseudo digitizer update #18113

Merged
merged 9 commits into from Apr 2, 2017
Merged

Conversation

nickmccoll
Copy link
Contributor

We will not have the realistic digitizer in time for the Muon TDR samples, so we have decided to import the pseudo digitizer (replacing the old one) used for granularity studies. Please see for a presentation on its development:

https://indico.cern.ch/event/594656/contributions/2403265/attachments/1390281/2117550/nmccoll_12_16_16_ME0Newsigis.pdf#search=Mc%20Coll

While it is useful for granularity/neutron/# of layer studies, I added in a feature to simply use the granularity as defined by the geometry. This allows for the digitization, and merging, of hits as expected for the ME0 granularity. It also adds a new collection, which is simply a map of integers...pointing from input digi index to new digi index. Since we filter and merge inputs, it is a many to one map with empty entries.

(moved from: #18112)

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @nickmccoll (Nick McColl) for master.

It involves the following packages:

DataFormats/GEMDigi
SimMuon/GEMDigitizer

@cmsbuild, @civanch, @mdhildreth, @kpedro88, @davidlange6 can you please review it and eventually sign? Thanks.
@jhgoh this is something you requested to watch as well.
@Muzaffar, @davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028

@civanch
Copy link
Contributor

civanch commented Mar 29, 2017

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 29, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/18774/console Started: 2017/03/29 10:59

@@ -12,18 +12,47 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "DataFormats/GEMDigi/interface/ME0DigiPreRecoCollection.h"

//#include "DataFormats/GeometryVector/interface/LocalPoint.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


//paramters
bool useBuiltinGeo ; //Use CMSSW defined geometry for digitization, not custom strips and partitions
unsigned int numberOfSrips ; // Custom number of strips per partition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix typo Srips -> Strips

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

)
inputCollection =cms.string('simMuonME0Digis'),
useBuiltinGeo =cms.bool(True), #Use CMSSW defined geometry for digitization, not custom strips and paritions
numberOfSrips =cms.uint32(384), # If use custom: number of strips per partition
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix typo Srips -> Strips

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if(!mainLayer->nEtaPartitions())
throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - ME0Layer has no partitions.";
if(mainLayer->nEtaPartitions() != 1)
throw cms::Exception("Setup") << "ME0ReDigiProducer::TemporaryGeometry::TemporaryGeometry() - This module is only compatitble with geometries that contain only one partiton per ME0Layer.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo partiton -> partition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

float middleDistanceFromBeam; // radiusOfMainPartitionInCenter;
std::vector<TrapezoidalStripTopology * > stripTopos; // vector of Topos, one for each part
std::vector<std::vector<double> > tofs ; //TOF to center of the partition: [layer][part]
std::vector<float> partionTops; //Top of each position in the chamber's local coords
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typos partion, position -> partition (?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

partionTops.reserve(numberOfPartitions);
for(unsigned int iP = 0; iP < numberOfPartitions; ++iP){
double eta = (etaTop -etaBottom)*double(iP + 1)/double(numberOfPartitions) + etaBottom;
double distFromBeam = std::fabs(2 * zBottom /(std::exp(-1*eta) - std::exp(eta) ));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to use std::sinh() here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

double etaBottom = globalBottom.eta();
double zBottom = globalBottom.z();
partionTops.reserve(numberOfPartitions);
for(unsigned int iP = 0; iP < numberOfPartitions; ++iP){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this loop could be combined with the next loop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

for(unsigned int iP = 0; iP < numberOfPartitions; ++iP){
const LocalPoint partCenter(0., getPartCenter(iP), 0.);
const GlobalPoint centralGP(mainChamber->layers()[iL]->etaPartitions()[0]->toGlobal(partCenter));
tofs[iL][iP] = (centralGP.mag() / 29.9792); //speed of light [cm/ns]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use CLHEP::c_light/CLHEP::cm (units of CLHEP::c_light are mm/ns)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<< "Done building temporary geometry!" << std::endl;

if(tempGeo->numLayers() != layerReadout.size() )
throw cms::Exception("Configuration") << "ME0ReDigiProducer::beginRun() - The geoemtry has "<<tempGeo->numLayers()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo geoemtry -> geometry

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

{
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these deleted comments no longer correct? It would be nice to replace them with an updated version, if so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (newRoll < ME0DetId::minRollId || newRoll > ME0DetId::maxRollId){
newRoll = detId.roll();

LogDebug("ME0ReDigiProducer::buildDigis") << "Begin bulding digis."<<std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typo bulding -> building

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

for(unsigned int iP = 0; iP < nPartitions; ++iP){
const unsigned int mapPartIDX = layer->etaPartitions()[iP]->id().roll() -1;
const GlobalPoint centralGP(layer->etaPartitions()[iP]->position());
tofs[mapLayIDX][mapPartIDX] = (centralGP.mag() / 29.9792); //speed of light [cm/ns]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to use CLHEP::c_light/CLHEP::cm (units of CLHEP::c_light are mm/ns)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

}

//filter if outside of readout window
const int bxIdx = std::round(tof/25.0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally "25" would be a constant member of the class (here and elsewhere, e.g. a few lines below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


//get digitized location
LocalPoint digiPartLocalPoint = topo->localPosition(stripF);
digiLocalError = topo->localError(stripF, 1./sqrt(12.));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation of magic number 12?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is the usual way to compute the resolution, dividing the strip pitch by sqrt(12)...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The std dev. of a flat distribution with length L is L/sqrt(12). The strip topology expects the error in units of strips. I added a comment.

@kpedro88
Copy link
Contributor

-1
pending responses to code review

@calabria
Copy link
Contributor

calabria commented Apr 1, 2017

can we please integrate this PR?

LogTrace("ME0ReDigiProducer::buildDigis") << "Starting with roll: "<< me0Id<<std::endl;

//setup map for this chamber/eta partition
ChamberDigiMap chDigiMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickmccoll - it looks like a std::vectorstd::tuple or at worst a std::mapstd::tuple,... would serve the purpose of this map of map of maps (!!) without all the memory problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidlange6 I changed it to a map of a tuple. I think it that the map is better than a vector in this case because when we create each digi we have to check if it has already been created.

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 1, 2017

Pull request #18113 was updated. @cmsbuild, @civanch, @mdhildreth, @kpedro88, @davidlange6 can you please check and sign again.

@davidlange6
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/18853/console Started: 2017/04/02 09:29

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2017

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2017

Comparison job queued.

@davidlange6 davidlange6 merged commit 04fee3d into cms-sw:master Apr 2, 2017
@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants