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
ME0 pseudo digitizer update #18113
Conversation
A new Pull Request was created by @nickmccoll (Nick McColl) for master. It involves the following packages: DataFormats/GEMDigi @cmsbuild, @civanch, @mdhildreth, @kpedro88, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here #13028 |
please test |
The tests are being triggered in jenkins. |
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix typo Srips -> Strips
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix typo Srips -> Strips
There was a problem hiding this comment.
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."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo partiton -> partition
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 (?)
There was a problem hiding this comment.
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) )); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo geoemtry -> geometry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
{ | ||
/* |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo bulding -> building
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)...
There was a problem hiding this comment.
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.
-1 |
can we please integrate this PR? |
LogTrace("ME0ReDigiProducer::buildDigis") << "Starting with roll: "<< me0Id<<std::endl; | ||
|
||
//setup map for this chamber/eta partition | ||
ChamberDigiMap chDigiMap; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Pull request #18113 was updated. @cmsbuild, @civanch, @mdhildreth, @kpedro88, @davidlange6 can you please check and sign again. |
please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
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)