753{
755
756 SoNode*
tail = pickedPath->getTail();
757
758
759 VP1CC_SoNode2CCMap::iterator itNode2CC =
m_clockwork->node2ccMap.find(
tail);
760
762
763
764 SG::ReadCondHandleKey<LArOnOffIdMapping> cablingKey ("LArOnOffIdMap");
765 cablingKey.initialize().ignore();
766 SG::ReadCondHandle<LArOnOffIdMapping>
cabling (cablingKey);
767
768 std::string channel_string = "";
770 VP1CC_LAr* larCC = dynamic_cast<VP1CC_LAr*>((*itNode2CC).second);
771 if(larCC) {
772 Identifier cellOffline = larCC->
getID();
773
774 std::ostringstream idstring;
776 idstring <<
"(b_ec=" <<
m_clockwork->calo_id->pos_neg(cellOffline) <<
", samp="
777 <<
m_clockwork->calo_id->sampling(cellOffline) <<
", reg="
778 <<
m_clockwork->calo_id->region(cellOffline) <<
", eta="
779 <<
m_clockwork->calo_id->eta(cellOffline) <<
", phi="
781 }
782 else if (
m_clockwork->calo_id->is_fcal(cellOffline) ) {
783 idstring <<
"(pos_neg=" <<
m_clockwork->calo_id->pos_neg(cellOffline) <<
",mod="
784 <<
m_clockwork->calo_id->sampling(cellOffline) <<
",eta="
785 <<
m_clockwork->calo_id->eta(cellOffline) <<
",phi="
787 }
788 channel_string = idstring.str();
789
790 HWIdentifier hwId;
791 try {
792 hwId =
cabling->createSignalChannelID(cellOffline);
793 } catch(LArID_Exception&) {
794 message(
"LArID Exception caught while creating signal channel id");
796 return;
797 }
798 channel_string +=
m_clockwork->lar_onlineID->channel_name(hwId);
799 }
800 }
801
802
803 std::vector<std::string>
msg;
804 try {
805 msg = (*itNode2CC).second->ToString(
m_clockwork->calo_id, channel_string);
806 } catch(std::runtime_error& err) {
808 return;
809 }
810
811 for(
unsigned int ii=0; ii<
msg.size(); ++ii)
813
814
816
818
819
820
821 VP1CC_LAr* larCC = dynamic_cast<VP1CC_LAr*>((*itNode2CC).second);
822 if(larCC) {
825 Identifier cellOffline = larCC->
getID();
826 HWIdentifier hwId;
827 try {
828 hwId =
cabling->createSignalChannelID(cellOffline);
829 } catch(LArID_Exception& e) {
830 message(
"EXCEPTION!! LArIDException caught while creating signal channel id!!");
832 return;
833 }
834
836 for(;itLArDig!=
m_clockwork->lar_digits->end(); ++itLArDig) {
837 if((*itLArDig)->hardwareID()==hwId) {
838
839 message(
"displaying LAr digits...");
840
841 try {
842 m_clockwork->controller->displayLArDigits( (*itLArDig)->nsamples(),
843 (*itLArDig)->samples(),
845 } catch (std::exception& e) {
847 std::cout <<
"ERROR!!! Exception caught! --> " <<
e.what() << std::endl;
848 QString
title =
"ERROR!!! Exception caught!";
849 QString mex =
"While displaying LAr digits, an exception has been caught!\n\nException details:\n\n" + QString::fromStdString(
e.what());
850 messageDebug(
"Clearing the DigitForm and returning...");
853 QWidget* widget = 0;
854 QMessageBox::warning( widget, title,
855 mex,
856 QMessageBox::Ok,
857 QMessageBox::Ok
858 );
860 return;
861 }
863 return;
864 }
865 }
866
867
868 message(
"Unable to find digits for the selected cell");
869 } else {
870 message(
"LAr digit display not available");
871 }
872
873
877 return;
878 }
879
880
881
882 VP1CC_TileBarEc* tileCC = dynamic_cast<VP1CC_TileBarEc*>((*itNode2CC).second);
883 if(tileCC) {
886 int frag1, channel1, frag2, channel2;
889
890
891 const TileDigits* digits1 = 0;
892 TileDigitsContainer::const_iterator itTileDig =
m_clockwork->tile_digits->begin();
893
894
895 for(;itTileDig!=
m_clockwork->tile_digits->end();++itTileDig) {
896 if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag1) {
898 digits1 = (**itTileDig)[channel1];
899
900
901 const TileDigits* digits2 = 0;
902 if(channel2==channel1) {
904
905 for(;itTileDig!=
m_clockwork->tile_digits->end();++itTileDig) {
906 if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag2) {
907 digits2 = (**itTileDig)[channel2];
908 break;
909 }
910 }
911 } else {
913 digits2 = (**itTileDig)[channel2];
914 }
915
916 if(digits2==0) {
918 message(
"Unable to find digits for the PMT 1");
920 return;
921 }
927 break;
928 }
929 }
930
931
932 if(digits1==0) {
933 message(
"Unable to find digits for the PMT 0");
935 return;
936 }
937
938
939
941 TileRawChannelContainer::const_iterator itTileRawCh =
m_clockwork->tile_rawchannel->begin();
942 const TileRawChannel* rawchannel1 = 0;
943
944 for(;itTileRawCh!=
m_clockwork->tile_rawchannel->end();++itTileRawCh) {
945
946 if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag1) {
947 rawchannel1 = (**itTileRawCh)[channel1];
948
949
950 const TileRawChannel* rawchannel2 = 0;
951 if(channel2==channel1) {
953
954 itTileRawCh =
m_clockwork->tile_rawchannel->begin();
955 for(;itTileRawCh!=
m_clockwork->tile_rawchannel->end();++itTileRawCh)
956 if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag2) {
958
959
960
961 break;
962 }
963 } else{
965 }
966 rawchannel2 = (**itTileRawCh)[channel2];
967
968 if(rawchannel2==0) {
969 message(
"Unable to get raw channel for PMT1");
970 break;
971 }
972
974 std::cout << "debug vars :" << rawchannel1 << " - " << rawchannel2 << std::endl;
975 std::cout <<
m_clockwork->tile_rawchannel << std::endl;
976 std::cout << digits1->
samples().size() << std::endl;
977
978
979 try {
981 } catch (TileCalib::InvalidRawChanUnit& e) {
983 std::cout <<
"ERROR!!! Exception caught from Tile! --> " <<
e.what() << std::endl;
984 QString
title =
"ERROR!!! Exception caught!";
985 QString mex =
"While displaying Tile Pulse, an exception has been caught!\n\nException details:\n\n" + QString::fromStdString(
e.what());
986 messageDebug(
"Clearing the DigitForm and returning...");
989 QWidget* widget = 0;
990 QMessageBox::warning( widget, title,
991 mex,
992 QMessageBox::Ok,
993
994
995 QMessageBox::Ok
996 );
998 return;
999 }
1001 break;
1002 }
1003 }
1004
1005 if(rawchannel1==0) {
1006 message(
"Unable to get raw channel for PMT0");
1007 }
1008
1010 return;
1011 }
1012 message(
"Unable to get drawer and channel IDs");
1013 } else
1014 message(
"Tile digit display not available");
1015
1016
1020 return;
1021 }
1022
1023
1024
1025 VP1CC_TileCrack* tileCrack = dynamic_cast<VP1CC_TileCrack*>((*itNode2CC).second);
1026 if(tileCrack) {
1031
1032 const TileDigits* digits = 0;
1033 TileDigitsContainer::const_iterator itTileDig =
m_clockwork->tile_digits->begin();
1034 for(;itTileDig!=
m_clockwork->tile_digits->end();++itTileDig) {
1035 if((*itTileDig)->size() >0 && (*itTileDig)->identify()==frag) {
1036 digits = (**itTileDig)[
channel];
1037
1041 break;
1042 }
1043 }
1044 if(digits==0) {
1045 message(
"Unable to find digits");
1047 return;
1048 }
1049
1050
1051
1052 TileRawChannelContainer::const_iterator itTileRawCh =
m_clockwork->tile_rawchannel->begin();
1053 const TileRawChannel* rawchannel = 0;
1054 for(;itTileRawCh!=
m_clockwork->tile_rawchannel->end();++itTileRawCh) {
1056 if((*itTileRawCh)->size()>0 && (*itTileRawCh)->identify()==frag) {
1057 rawchannel = (**itTileRawCh)[
channel];
1059 }
1060 }
1061 if(rawchannel==0)
1062 message(
"Unable to get raw channel");
1063
1064 return;
1065 }
1066 message(
"Unable to get drawer and channel ID");
1067 } else
1068 message(
"Tile digit display not available");
1069
1071
1072 return;
1073 }
1074
1075 }
1076 return;
1077 }
1078
1080
1081
1082 std::vector<std::string>
msg =
m_clockwork->mbtsHelper->userPickedNode(pickedNode);
1083 for(
unsigned int ii=0; ii<
msg.size(); ++ii)
1085}
DataModel_detail::const_iterator< DataVector > const_iterator
IVP1ChannelWidget * channel() const
int NtimeSamples(void) const
const std::vector< float > & samples() const
int GetFragChannel(const TileHWID *tile_hw_id, bool up, int &frag, int &channel)
int GetFragChannel(const TileHWID *tile_hw_id, bool up, int &frag, int &channel)
std::string tail(std::string s, const std::string &pattern)
tail of a string