162 for (edm::PSimHitContainer::const_iterator _hit = rpcHits.begin();
163 _hit != rpcHits.end(); ++_hit){
169 float posX = roll->
strip(_hit->localPosition())
170 - static_cast<int>(roll->
strip(_hit->localPosition()));
172 std::vector<float> veff = (
getRPCSimSetUp())->getEff(rpcId.rawId());
174 std::stringstream veffstream; veffstream<<
"[";
175 for(std::vector<float>::iterator veffIt = veff.begin(); veffIt != veff.end(); ++veffIt) { veffstream<<(*veffIt)<<
","; }
178 LogDebug(
"RPCSimAsymmetricCls")<<
"Get Eff from RPCSimSetup for detId = "<<rpcId.rawId()<<
" :: "<<veffstr;
182 int centralStrip = topology.
channel(entr)+1;
183 float fire = CLHEP::RandFlat::shoot(engine);
184 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire<<
" --> < "<<veff[centralStrip-1]<<
" ? --> "<<((fire < veff[centralStrip-1])?1:0);
186 if (fire < veff[centralStrip-1]) {
187 LogDebug (
"RPCSimAsymmetricCls")<<
"Detector is Efficient for this simhit";
189 int fstrip=centralStrip;
190 int lstrip=centralStrip;
199 LogDebug (
"RPCSimAsymmetricCls")<<
"Clustersize = "<<clsize;
201 std::vector<int> cls;
203 cls.push_back(centralStrip);
205 for (
int cl = 0;
cl < (clsize-1)/2;
cl++){
206 if (centralStrip -
cl -1 >= 1 ){
207 fstrip = centralStrip-
cl-1;
208 cls.push_back(fstrip);
210 if (centralStrip + cl + 1 <= roll->
nstrips() ){
211 lstrip = centralStrip+cl+1;
212 cls.push_back(lstrip);
223 if (lstrip < roll->nstrips() ){
225 cls.push_back(lstrip);
230 cls.push_back(fstrip);
237 if (lstrip < roll->nstrips() ){
239 cls.push_back(lstrip);
246 float fire1 = CLHEP::RandFlat::shoot(engine);
247 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire1<<
" (fire1 is used for a shift of the cluster)";
265 std::vector<double> TMPclsAsymmForDetId
268 for(
unsigned int i = 0;
i < TMPclsAsymmForDetId.size();
i ++){
269 if(fire1 < TMPclsAsymmForDetId[
i]){
276 vector<int> shifted_cls;
283 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
284 if(*
i+strip_shift < min_strip){
285 min_strip = *
i+strip_shift;
287 if(*
i+strip_shift > max_strip){
288 max_strip = *
i+strip_shift;
292 if(min_strip<1 || max_strip-roll->nstrips()>0){
297 for (std::vector<int>::iterator
i=cls.begin();
i!=cls.end();
i++){
298 shifted_cls.push_back(*
i+strip_shift);
300 for (std::vector<int>::iterator
i=shifted_cls.begin();
301 i!=shifted_cls.end();
i++){
303 if(*
i != centralStrip){
304 double fire2 = CLHEP::RandFlat::shoot(engine);
305 LogDebug (
"RPCSimAsymmetricCls")<<
"[RPCSimAsymmetricCls::simulate] Fired RandFlat :: "<<fire2<<
" (check whether adjacent strips are efficient)";
306 if(fire2 < veff[*
i-1]){
307 std::pair<int, int> digi(*
i,time_hit);
309 LogDebug (
"RPCSimAsymmetricCls")<<
"RPC Digi inserted :: Signl :: DetId :: "<<rpcId<<
" = "<<rpcId.rawId()<<
" ==> digi <"<<digi.first<<
","<<digi.second<<
">";
315 std::pair<int, int> digi(*
i,time_hit);
319 LogDebug (
"RPCSimAsymmetricCls")<<
"RPC Digi inserted :: Signl :: DetId :: "<<rpcId<<
" = "<<rpcId.rawId()<<
" ==> digi <"<<digi.first<<
","<<digi.second<<
">";
float strip(const LocalPoint &lp) const
LocalPoint centreOfStrip(int strip) const
CaloTopology const * topology(0)
DetectorHitMap theDetectorHitMap
void setRPCSimSetUp(RPCSimSetUp *simsetup)
RPCSimSetUp * getRPCSimSetUp()
const RPCRollSpecs * specs() const
int getSimHitBx(const PSimHit *, CLHEP::HepRandomEngine *)
std::set< std::pair< int, int > > strips
uint32_t rawId() const
get the raw id
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)
const Topology & topology() const