File tree Expand file tree Collapse file tree
Detectors/MUON/MCH/PreClustering/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,14 +125,23 @@ void PreClusterFinder::loadDigit(const Digit& digit)
125125{
126126 // / fill the Mapping::MpDE structure with fired pad
127127
128- int deIndex = mDEIndices [digit.getDetID ()];
129- assert (deIndex >= 0 && deIndex < SNDEs);
128+ int deIndex = mDEIndices .at (digit.getDetID ());
130129
131130 DetectionElement& de (*(mDEs [deIndex]));
132131
132+ if (digit.getPadID () < 0 || digit.getPadID () >= de.mapping ->nPads [0 ] + de.mapping ->nPads [1 ]) {
133+ throw out_of_range (" invalid pad index" );
134+ }
135+
133136 uint16_t iPad = digit.getPadID ();
134137 int iPlane = (iPad < de.mapping ->nPads [0 ]) ? 0 : 1 ;
135138
139+ // check that the pad is not already fired
140+ if (de.mapping ->pads [iPad].useMe ) {
141+ LOG (error) << " multiple digits on the same pad (DE " << digit.getDetID () << " , pad " << iPad << " )" ;
142+ return ;
143+ }
144+
136145 // register this digit
137146 uint16_t iDigit = de.nFiredPads [0 ] + de.nFiredPads [1 ];
138147 if (iDigit >= de.digits .size ()) {
You can’t perform that action at this time.
0 commit comments