Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:27

0001 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0002 #include "Fireworks/Calo/plugins/FWCaloRecHitDigitSetProxyBuilder.h"
0003 
0004 class FWHFRecHitProxyBuilder : public FWCaloRecHitDigitSetProxyBuilder {
0005 public:
0006   FWHFRecHitProxyBuilder(void) { invertBox(true); }
0007   ~FWHFRecHitProxyBuilder(void) override {}
0008 
0009   REGISTER_PROXYBUILDER_METHODS();
0010 
0011   FWHFRecHitProxyBuilder(const FWHFRecHitProxyBuilder&) = delete;
0012   const FWHFRecHitProxyBuilder& operator=(const FWHFRecHitProxyBuilder&) = delete;
0013 };
0014 
0015 REGISTER_FWPROXYBUILDER(FWHFRecHitProxyBuilder, HFRecHitCollection, "HF RecHit", FWViewType::kISpyBit);
0016 
0017 // AMT: Reflect box. Previously used energyScaledBox3DCorners(). Scaling and e/et mode added now.
0018 
0019 /*
0020 void
0021 FWHFRecHitProxyBuilder::build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* )
0022 {
0023    const HFRecHitCollection* collection = 0;
0024    iItem->get( collection );
0025 
0026    if( 0 == collection )
0027    {
0028       return;
0029    }
0030 
0031    std::vector<HFRecHit>::const_iterator it = collection->begin();
0032    std::vector<HFRecHit>::const_iterator itEnd = collection->end();
0033    for( ; it != itEnd; ++it )
0034    {
0035       if(( *it ).energy() > m_maxEnergy )
0036          m_maxEnergy = ( *it ).energy();
0037    }
0038 
0039    TEveBoxSet* boxSet = addBoxSetToProduct(product);
0040    int index = 0;
0041    for (std::vector<HFRecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
0042    {  
0043       unsigned int rawid = ( *it ).detid().rawId();
0044       if( ! context().getGeom()->contains( rawid ))
0045       {
0046          fwLog( fwlog::kInfo ) << "FWHFRecHitProxyBuilder cannot get geometry for DetId: "
0047                                << rawid << ". Ignored.\n";
0048       }
0049       const float* corners = context().getGeom()->getCorners( rawid );
0050 
0051       std::vector<float> scaledCorners(24);
0052       if (corners)
0053          fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);
0054 
0055       addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
0056    }
0057 }
0058 */