163 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
164 _hit != rpcHits.end(); ++_hit){
170 float posX = roll->
strip(_hit->localPosition())
171 - static_cast<int>(roll->
strip(_hit->localPosition()));
173 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
175 std::stringstream veffstream; veffstream<<
"[";
176 for(std::vector<float>::iterator veffIt = veff.begin(); veffIt != veff.end(); ++veffIt) { veffstream<<(*veffIt)<<
","; }
179 LogDebug(
"RPCSimAsymmetricCls")<<
"Get Eff from RPCSimSetup for detId = "<<rpcId.rawId()<<
" :: "<<veffstr;
183 int centralStrip = topology.
channel(entr)+1;
184 float fire = CLHEP::RandFlat::shoot(engine);
185 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire<<
" --> < "<<veff[centralStrip-1]<<
" ? --> "<<((fire < veff[centralStrip-1])?1:0);
187 if (fire < veff[centralStrip-1]) {
188 LogDebug (
"RPCSimAsymmetricCls")<<
"Detector is Efficient for this simhit";
190 int fstrip=centralStrip;
191 int lstrip=centralStrip;
200 LogDebug (
"RPCSimAsymmetricCls")<<
"Clustersize = "<<clsize;
202 std::vector<int> cls;
204 cls.push_back(centralStrip);
206 for (
int cl = 0;
cl < (clsize-1)/2;
cl++){
207 if (centralStrip -
cl -1 >= 1 ){
208 fstrip = centralStrip-
cl-1;
209 cls.push_back(fstrip);
211 if (centralStrip + cl + 1 <= roll->
nstrips() ){
212 lstrip = centralStrip+cl+1;
213 cls.push_back(lstrip);
224 if (lstrip < roll->nstrips() ){
226 cls.push_back(lstrip);
231 cls.push_back(fstrip);
238 if (lstrip < roll->nstrips() ){
240 cls.push_back(lstrip);
247 float fire1 = CLHEP::RandFlat::shoot(engine);
248 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire1<<
" (fire1 is used for a shift of the cluster)";
266 std::vector<double> TMPclsAsymmForDetId
269 for(
unsigned int i = 0;
i < TMPclsAsymmForDetId.size();
i ++){
270 if(fire1 < TMPclsAsymmForDetId[
i]){
277 vector<int> shifted_cls;
284 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
285 if(*
i+strip_shift < min_strip){
286 min_strip = *
i+strip_shift;
288 if(*
i+strip_shift > max_strip){
289 max_strip = *
i+strip_shift;
293 if(min_strip<1 || max_strip-roll->nstrips()>0){
298 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
299 shifted_cls.push_back(*
i+strip_shift);
301 for (std::vector<int>::iterator
i=shifted_cls.begin();
302 i!=shifted_cls.end();
i++){
304 if(*
i != centralStrip){
305 double fire2 = CLHEP::RandFlat::shoot(engine);
306 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire2<<
" (check whether adjacent strips are efficient)";
307 if(fire2 < veff[*
i-1]){
308 std::pair<int, int> digi(*
i,time_hit);
310 LogDebug (
"RPCSimAsymmetricCls")<<
"RPC Digi inserted :: Signl :: DetId :: "<<rpcId<<
" = "<<rpcId.rawId()<<
" ==> digi <"<<digi.first<<
","<<digi.second<<
">";
316 std::pair<int, int> digi(*
i,time_hit);
320 LogDebug (
"RPCSimAsymmetricCls")<<
"RPC Digi inserted :: Signl :: DetId :: "<<rpcId<<
" = "<<rpcId.rawId()<<
" ==> digi <"<<digi.first<<
","<<digi.second<<
">";
float strip(const LocalPoint &lp) const
const Topology & topology() const override
LocalPoint centreOfStrip(int strip) const
CaloTopology const * topology(0)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
constexpr uint32_t rawId() const
get the raw id
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
std::set< std::pair< int, int > > strips
edm::DetSet< RPCDigiSimLink > RPCDigiSimLinks
Container::value_type value_type
virtual int channel(const LocalPoint &p) const =0
const std::vector< double > & getAsymmetryForCls(uint32_t id, uint32_t slice, uint32_t cls)
int getClSize(float posX, CLHEP::HepRandomEngine *)
RPCSynchronizer * _rpcSync
RPCDigiSimLinks theRpcDigiSimLinks
unsigned int slice(float posX)